lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Diviacco <patrick.divia...@gmail.com>
Subject Re: Am I correctly parsing the strings ? Terms or Phrases ?
Date Mon, 21 Mar 2011 17:05:14 GMT
>
>
> If description field is tokenized/analyzed during indexing you need to use
> PhraseQuery.
>

Uhm yeah I'm using a WhitespaceAnalyzer. This is the code using for
indexing:

writer = new IndexWriter(FSDirectory.open(INDEX_DIR), new
IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_40, new
WhitespaceAnalyzer(org.apache.lucene.util.Version.LUCENE_40)));
...
document.add(new Field("description", flickrDoc.getDescription(),
Field.Store.YES, Field.Index.ANALYZED));
...
writer.addDocument(document);



May you can use QueryParser instead?
>
> Why ? Can't I just use PhraseQuery ? What is QueryParser for?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message