lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <>
Subject Re: Facet searching on single field with multiple words value
Date Thu, 21 Jun 2007 15:15:56 GMT
Hi Sawan,

Sawan Sharma wrote:
> Now, The problem occured when I passed the multiple words in term query.
> e.g.<code>
> QueryFilter filter = new QueryFilter(new TermQuery(new Term(FieldName,
> FieldValue)));
> <code>
> where field name  and field value dynamically getting.
> here we take the example value.
> FieldName:- "Title"
> FieldValue:- "Software Development" ot it may be "Software AND
> Development".
> In this case i'm not getting the result. i.e . counts= 0.

It looks to me as though you expect the "Software AND Development" query
to be parsed so that it matches a document containing both "Software"
and "Development" terms, but TermQuery does not do query parsing - in
the code above, you are telling Lucene to use "Software AND Development"
as a literal string to be matched.

Perhaps you should be using QueryParser[1] to parse user-supplied queries?

At a minimum, you should make sure that the analyzer used to produce
your index is compatible with the one you use with your queries.  The
simplest form of compatibility, of course, is to use the same analyzer
in both places.  (See the FAQ "Why is it important to use the same
analyzer type during indexing and search?"[2])

As always when questions about the contents of indexes come up, Luke[3]
is indispensable.


[3] <>

Steve Rowe
Center for Natural Language Processing

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

View raw message