Advertisement:

Author Topic: Main Search to search in tags as well  (Read 965 times)

destabilizator

  • Newbie
  • *
  • Posts: 24
Main Search to search in tags as well
« on: August 31, 2015, 04:37:25 pm »
I'm using http://plugins-zone.com/free-plugins-for-osclass/tags-plugin.html and I'd like following to happen:

- User enters eg. "blabla hehe" in the main-search field
- apart from normal search, I'll take the user's input, split it to "blabla" and "hehe" words
- I'd like to search for "blabla" and "hehe" also in tags, so the output of the search is every listing where "blabla hehe" is written + those which have "blabla" and "hehe" as tags

Bonus tought: would it be hard to modify even the normal search so it does search for "blabla hehe" "blabla" "hehe"?

laptop

  • Newbie
  • *
  • Posts: 6
Re: Main Search to search in tags as well
« Reply #1 on: August 31, 2015, 05:37:23 pm »
I do not know how the tag plugin works but you can get what you want without using any plugin if you wanted to know what the users are searching.

Just enable Save latest searches from admin menu and enter <?php echo osc_get_latest_searches();?> to show it latest searches and link it.

destabilizator

  • Newbie
  • *
  • Posts: 24
Re: Main Search to search in tags as well
« Reply #2 on: September 01, 2015, 10:17:57 am »
I do not know how the tag plugin works but you can get what you want without using any plugin if you wanted to know what the users are searching.

Just enable Save latest searches from admin menu and enter <?php echo osc_get_latest_searches();?> to show it latest searches and link it.

That's not what I want. The tags plugin is simple, it allows user to put up to certain amount of tags on their listing. Then you can search by tags too.

I'm trying to use this to overcome the stupidity of my language in searches without lexer (afaik OSClass doesn't have any, it just looks for the exact words in the listings).

teseo

  • Hero Member
  • *****
  • Posts: 6169

destabilizator

  • Newbie
  • *
  • Posts: 24
Re: Main Search to search in tags as well
« Reply #4 on: September 02, 2015, 10:53:52 am »
Hi,

Take a look here:

http://forums.osclass.org/general-help/important-how-to-have-a-really-funcional-search/msg112640/#msg112640

Regards

This helped to certain extent, it's great that it now searches "subwords" and also splits multiword search string into separate words and looks for these...
Now I need it to search those split words also in name="tags".

If I add
Code: [Select]
<input type="hidden" name="tags" id="tags" value="">into the search form code and set value to some existing tag and search, it is found, but the main search thingy has to remain empty. If I type the same value into search (the word on the tag is in no listing's text) and copy it to value of tags, then it's not found.