lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Hadianto" <vic...@hadianto.net>
Subject Re: Rephrase My Question - How To Search Database With More Than One Pair of Property/Value as Parameters Using Lucene?
Date Fri, 07 Nov 2003 08:56:16 GMT
> Nonetheless, both "creator" and the name of the
> creator are variables.  We depend on the user to give

Of course, but you don't have unlimited fields right? So you know that
"creator" field is the creator of a book. You can provide the user with
complicated UI but internally you can build your own query.

> Query query = QueryParser.parse("creator:\"Elizabeth
> Castro\" AND category:\"Computer Science\"",
> "creator" AND "category",  // Is this right?
> new StandardAnalyzer());
> indexSearcher.search(query);

http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/queryParser/QueryParser.html

> How does the Luncene know it is AND instead of OR we
> want?

It doesn't, *you* tell it whether it's AND or OR. Think Google. Only Lucene
does OR by default (or so as I rememebred it).


/victor


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message