View Single Post
Old 09-07-2004, 07:34 PM   #1 (permalink)
Outpour
Upright
 
[php/mysql]search queries and handling

I'm having some problems implementing my concept of searching on my blog [www.binaryelysium.com].

This is the way I am attempting to run a query. Searcher submits terms ie: "large red clowns."

What I want to do is give results in the following order (top with highest priority):
  1. results that include all terms
  2. results that include all terms minus one
  3. results that include all terms minus two
  4. and so on until one term remains this one is displayed at the very end

So... for the above example the user would get:
  • posts with the the striing "large red clowns"
  • posts with the string "large red"
  • posts with the string "large clowns"
  • posts with the string "red clowns"
  • posts with the string "large"
  • posts with the string "red"
  • posts with the string "clowns"

But the last three ordered in such a manner of being most recent.
Does anyone have any idea how I could go about doing it?
Outpour is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46