Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Search sort problem

Quote Reply
Search sort problem
Hi,

I am not using a Category field.

When I perform a search, the results are in a crazy order. They seem to sorted alphabetically but groups by groups, and not taking in consideration all the results

In Links.pm, I have:
$LINKS{build_sort_order_search} = "Name DESC";

where Name is the field I want to use for sorting.

How can I force the sorting by "Name"? I don't mind if the building process doesn't work, since I only use "search.cgi outputs".

Thanks.

Quote Reply
Re: Search sort problem In reply to
First,

Links have "Name", categories have "Title"

$LINKS{build_sort_order_search} = "Title DESC";

to sort on a Link title.


Second, and the biggest problem.... is that the same logic error in search.pm that has caused the searching problem has forced the return of links to be in only "score" order, meaning the most relavent first.

The only way around this is to rewrite the search query routine, and no one has undertaken that yet.

$link_hits = $linkdb->query ( { query => $query, mh => $mh, nh => $nh, filter => \%filter, ww => $ww } );

Rewriting the query routine is a non-trival task.

This was a problem pointed out early on with the 1.11 release. Somewhere in the rush to get the requests for "score" order to work, the non-score order and 'AND/OR' searching (passed parameters) got short circuited.

If you are wanting to use some other sort of search criteria, you can write your own routines, but you lose the in depth seaching of the query routine.

For instance, most people who search on "love and romance" want to find the most relative links -- not links in alphabetical order. When this logic was added, other stuff broke.

While this has been a frustrating thing with the 1.11 version, the search module having these problems, hopefully all these and more are fixed in the next version. Remember, searching is doing a lot of different things, and all sorts of short cuts and tricks have to be used to make it a real-time process. Then, support for different languages had to be added, and by the time you mixed all of the basics, with all the stuff everyone wanted, the module just didn't work right.

There are a lot of things a search module can -- and should -- do, but it has to be written from the ground up, and has to take all the things people want into consideration. Then, it has to be extensible. Meaning, all the various actions encapsulated into function calls that can be strung together to return whatever query values are asked for.


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Search sort problem In reply to
Sounds more complicated than I thought...

Could I just override the "score sort order" ?

Quote Reply
Re: Search sort problem In reply to
No, because that would in effect fix the above bugs.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Search sort problem In reply to
Hello Ekaram,

Well like pugdog is saying it isn't easy! I am trying to sort all the links on Add_Date with no luck yet. But you have to see the logic of search option first, like the best link will appear above. Well pugdog explained my before and till now i haven't come up with a better solution.

I quess we have to make the total score all 1 points for all found links. Then it will sort. But because of all different scores they sort is 'doomed'. And maybe it's also sorting on category, but that i don't know yet.

If i found a way arround i'll tell you here.

Just to let you know that you are not the only 1 with this problem right now.

Regards Startpoint.