lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhi <abhirama.b...@gmail.com>
Subject Phrase search
Date Fri, 05 Jun 2009 11:31:15 GMT
Say I have indexed the following strings:

1. "cool gaming laptop"
2. "cool gaming lappy"
3. "gaming laptop cool"

Now when I search with a query say "cool gaming computer", I want string 1
and 2 to appear on top (where search terms are closer to each other)
followed by 3.

I can use a Term query to search but, the problem is that word proximity
does not come into picture. All 3 document get an even score. The behaviour
that I want is documents that have "cool" and "gaming" and "computer" (these
words might be present or not in the indexed document) as close to each
other as possible should get a higher score.

I can use a Phrase query so that proximity of search terms affect scoring
but, I do not get any result because string "computer" is not present in any
of the indexed documents.

Is there a way to achieve the above?
-- 
Cheers,
Abhi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message