Phrase Query Help
1 posts in topic
Flat View  Flat View

Posted By:   rimmer_arnold
Posted On:   Saturday, January 25, 2003 12:02 PM

can somone help me with the below code as i dont understand why it does not work?. when i type in a search say scooby doo , the text prints out Searching for "Scooby doo" notice scooby doo in inverted comas but it does not return any results

PhraseQuery query = new PhraseQuery();

Term phrase = new Term("contents", questionText.getText() );



displayp1.setText("Searching for " + query.toString("contents"));

Hits hits = searcher.search(query);

Re: Phrase Query Help

Posted By:   Otis_Gospodnetic  
Posted On:   Saturday, January 25, 2003 07:22 PM

I don't understand what you mean by "notice scooby doo in inverted comas", but it is possible that no document with that phrase was added to the index, or maybe not to the field names 'contents', etc.
About | Sitemap | Contact