On Wednesday 14 April 2004 20:55, Armbrust, Daniel C. wrote:

> > Is there anything that I can do in my query construction, to ensure that if
> > a query exactly matches a document, it will be the top result?

I know of two methods (and would be happy to hear comments or
additions):

1) index the field as a Keyword.  The only result of querying this will
be exact (character-by-character identical) matches.  You can index the
field both as Keyword and as Text if you wish, and construct a query
that attempts both the exact and inexact match, with appropriate
weights.

2) A bit of a hack perhaps, but effective: index the field as "zgzgl
text of field zgzgl", and query for the phrase "zgzgl text of query
zgzgl".  "zgzgl" here stands for some token that doesn't otherwise occur
in your data.  Any matches to this phrase, then, are guaranteed to be
matches to complete document fields, but with accommodation for
stopwords, stemming, or whatever your Analyzer does.  Add slop to the
phrase query if you wish, and again, you can attach appropriate weights
to this and combine with other techniques.

Boris
-- 
Boris Goldowsky
[EMAIL PROTECTED]
www.goldowsky.com/consulting


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to