FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » uasort strange problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: uasort strange problem [message #173461 is a reply to message #173458] Wed, 13 April 2011 18:47 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Peter)

> In article <io2u9e$mi3$1(at)dont-email(dot)me>, jstucklex(at)attglobal(dot)net says...
>
>> P.S. In general, it's better to let the database do the sorting. Maybe
>> you would like to follow up on that end in comp.databases.mysql.
>>
> Like I said, it's not really an option. The results are originally
> ordered by relevancy based upon looking in the product name and...
>
> Any records that have the complete matching string in them, then
> Any records where the string contains all words but not in any order,
> then
> Any record that contains any of the words used in the search string
>
> After that I then have to search on more detailed product information
> using the same criteria
>
> I have steered well clear of even attempting any SQL query to allow me
> to perform such a search that would allow me to return the records in
> the correct order, so I have to copy all queries to any array and then
> remove any duplicates.
>
> If you believe this may be possible then I'll certainly ask this in
> comp.databases.mysql.

It should definitely be possible. You can sort by many different
criteria. You can create values for sorting "at runtime" (e.g. a "1" for
a complete match and a "2" for a partly match, then take these numbers
into account for sorting). And if nothing else helps you can use sub
queries, combine their results and then sort that final result set.

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Joomla, Wordpress, Expression Web
Next Topic: How can I serialize zend_http_request object?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 14:05:12 GMT 2024

Total time taken to generate the page: 0.04426 seconds