lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Search in appendable fields
Date Tue, 15 Mar 2005 16:42:38 GMT
Hello,

PhraseQuery will help you do that, as will BooleanQuery (make both
clauses required), or Boolean operators (using + in front of each term
or AND between them) if you are parsing the query string with
QueryParser:
  http://www.lucenebook.com/search?query=phrase+query
  http://www.lucenebook.com/search?query=boolean+query

+name:Otis


--- Jerónimo López Bezanilla <jlopez@bassy.net> wrote:
> I want to index articles:
> My document is:
> - Title
> - Authors
> 
> There are one or more authors, and I index the field with "Appendable
> 
> Fields" (page 68, Lucene in action).
> 
> Document doc = new Document();
> doc.add(Field.Text("Title", title));
> doc.add(Field.Text("Author", author1));
> doc.add(Field.Text("Author", author2));
> 
> For example I have this documents:
> 
> Title: "Lucene in Action"
> Author1: "ERIK HATCHER"
> Author2: "OTIS GOSPODNETIC"
> 
> Title: "Lucene in 21 days"
> Author1: "OTIS HATCHER"
> Author2: "LOPEZ JESUS"
> 
> And the problem is that if I search by the author "OTIS HATCHER" y
> get 
> both documents as a hit, but only the second one is valid.
> How can i force that all words of "OTIS HATCHER" must appear in the
> same 
> field?
> 
> 
> Thanks
> Jerolba
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 

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


Mime
View raw message