lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Query question
Date Fri, 03 Nov 2006 07:12:32 GMT

: 1.) I have data like name="Jeff" lastname="Richley" age="33" and I need to
: be able to query by any combination such as name="Jeff" age="33".  But if
: I query with name="Jeffrey" there is no match.
: 2.) The name value pairs are not really controlled until the end user is
: inserting information or querying.  I may have the data from the previous
: example and then have another that has address information and then
: something totally unrelated such as stock prices.  The point is, I can't
: guarantee what exactly will be in the data.

Lucene will fit your needs because of your second point nicely, Documents
don't need to all have hte same fields.

as to your first point, and your question about 100% matches, Lucene
should be able to meet your needs perfectly, you just have to understand
how to ask it the right question.  lemme give you a quick check list of
things to keep in mind, and as you dig into the documentation these will
make more sense...

 1) Use only UN_TOKENIZED fields when adding your documents, and if you
use QueryParser to build your queries for you, use the KeywordAnalyzer to
make sure no lowercasing or stemming takes place.
 2) OMIT_NORMs when indexing .. they only matter if you want the lengths
of fields to affect the score, and you don't -- you only want to know if
it matched or not.
 3) if you want to require name="jeff" and age="33" make sure you
construct a query where all clauses are mandatory .. the default in the
query parser is "SHOULD" meaning only one clause is mandatory, and the
other clauses increase the score.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message