PDA

View Full Version : change search order in tags



Pete Young
November 23, 2017, 12:35 AM
I thought I had asked this but can not find anything, but how do I change the default sort order in tags I want to change to all words in any order, (or exact match) depending ?

thanks

Pete Young
December 2, 2017, 04:31 AM
No Answer to this one ? the search in tags is near shocking for results in that is will produce 90 results for just 2 items relating to the search ? is there a way to tighten this up ?

Bahram Soltanirad
December 2, 2017, 10:06 AM
Tightening result is not related to search order or sort order. It is related to search mode should be defined for tag cloud plugin.
Totally, there are 4 kind of search modes in flynax

1 - All words, any order
2 - Any words, any order
3 - Exact words, exact order
4 - Exact words, any order

Unfortunately, there is no definition for search mode in plugin (i checked with tag cloud v2.0.4)
So it gets default search mode which is number 2

If you want to change search mode for tag cloud plugin, there are two ways.

1. Flynax team upgrade plugin to get search mode in admin panel from user.
2. Change some codes like below

Go to plugins/tag_cloud plugin folder/tags.inc.php

Find:

$data['keyword_search'] = $tag_info['Tag'];
Add the following lines below it:

array_push($data,"keyword_search_type");
$data['keyword_search_type'] = 4;

You can change number 4 to 3 (1 or 2).

Pete Young
December 2, 2017, 12:13 PM
@ Bahram Soltanirad / Thanks I will give that a whirl and see if I can get better results, because as a user I know if I was to use a site for a search term and end up with a pile of unrelated listings I would not be happy, so lets hope this will fix it. Thank you for your help.

I will report back on the fix here.

Pete Young
December 5, 2017, 08:51 AM
@ Bahram, a huge thanks the code works great and works in exactly the same as search options, so now search and tags produce the exact same result.

Note. the option number 4 even though it is listed produced an error, but if you look number 1 is basically the same and works well so 1 is being being used. I have also edit my search default to number 1 as well.

Thank you again
Regards
Pete