It still fails even when there are no stop words.  I'm going to try a
PhraseQuery instead of relying on the QueryParser.

Regards,

Paul 


-----Original Message-----
From: java-user-return-45151-paul.b.murdoch=saic....@lucene.apache.org
[mailto:java-user-return-45151-paul.b.murdoch=saic....@lucene.apache.org
] On Behalf Of Digy
Sent: Wednesday, February 24, 2010 4:45 PM
To: java-user@lucene.apache.org
Subject: RE: Phrase Search and NOT_ANALYZED

Since it is not analyzed, your text is stored as a single term in the
index
[something in the index].
But the query 
        name:"something in the index"
is translated as :
  find 4 consecutive terms which have values "something", "in","the" and
"index"  respectively.
or if stop words are removed 
  find 2 consecutive terms which have values "something" and "index"

You should either index it ANALYZED or use TermQuery while searching.

DIGY

-----Original Message-----
From: Murdoch, Paul [mailto:paul.b.murd...@saic.com] 
Sent: Wednesday, February 24, 2010 10:51 PM
To: java-user@lucene.apache.org
Subject: Phrase Search and NOT_ANALYZED

Hi,

 

I'm indexing a field using the StandardAnalyzer 2.9.

 

field = new Field(fieldName, fieldValue, Field.Store.YES,
Field.Index.NOT_ANALYZED);

 

Let's say fieldName is "name" and fieldValue is "something in the
index".  When I perform the query...

 

name:"something in the index"

 

... I don't get a hit.  I'm using the StandardAnalyzer for searching.
I've tested this with Luke and it doesn't work there either.  What am I
missing?

 

Thanks,

 

Paul

 



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


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

Reply via email to