On Wed, Jun 12, 2002 at 10:16:44AM -0700, lcrocker@nupedia.com wrote:
The first simplification I did was to get rid of the parser because it wasn't necessary--SQL is already doing it, so I just pass on the ANDs, ORs, and NOTs as they are.
The point of the parser was to detect the cases where the query was not well-formed, unbalanced brackets, "A and or B", et cetera, and then give some kind of syntax error to indicate what is wrong. What do you do with those cases now?
Btw. is it correct that you only highlight one search word per line in the result of the search?
The second change I made to the search was to parse the article text into a separate field the way we were already doing for titles.
Ah, I see, sorry for not checking your code first. So that is why the scoring doesn't work anymore. The simplest way to get scoring back is probably to not eliminate duplicates when processing.
We could also do our own scoring after MySQL returns the raw results, but that would require making a pass through the entire result set before displaying anything.
Not necessarily. The usual way to do this is define your own index table like
Text_index(word, article, #occurrences)
and then you let MySQL compute some sort of scoring and sort on that. This is tricky if you have OR and NOT but with only AND this is easy.
-- Jan Hidders