dcsimg
Indexing for a PhraseQuery search, and searching across multiple fields
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Charlie_B
Posted On:   Tuesday, May 11, 2004 08:56 AM

I have looked at using the PhraseQuery class to search for a phrase within the content of a particular document.


Are there any good examples out there of code which uses the Phrasequery?


If i want to search for the phrase "i am here" do i need to add terms to the phrasequery object e.g

pq.add(new Term(BODY, "i"));

pq.add(new Term(BODY, "am"));

pq.add(new Term(BODY, "here"));

When indexing the content of the document do I have to give the Field that contains the content "true, true, true" as the arguments for "store, index, token"?

Re: Indexing for a PhraseQuery search, and searching across multiple fields

Posted By:   Otis_Gospodnetic  
Posted On:   Wednesday, May 12, 2004 01:14 AM

There is no need to store a field, unless you want to display it to the user, for instance on a search results screen.


The first part of your question is already answered in Lucene Javadoc.

About | Sitemap | Contact