You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by Jean-Claude Antonio <jc...@arcetis.com> on 2007/12/18 11:48:30 UTC

Query issue

|Hello, I have the following query problem.

With the below code,|| the query
"\\[prop\\]voila\\:type:RE" works well
but
"\\[prop\\]voila\\:type:IS" does not return any value (Hits size is 0)
The document was though added to the index (I can retrieve the IS 
document with some other query and the field was well popultated with 
"IS" value).
Any clue?


||
Document doc = new Document();
doc.add(new Field("[prop]voila:type", "IS", Field.Store.YES, 
Field.Index.TOKENIZED));
...
writer.addDocument(doc);

doc = new Document();
doc.add(new Field("[prop]voila:type", "RE", Field.Store.YES, 
Field.Index.TOKENIZED));
...
writer.addDocument(doc);


|

Re: Query issue

Posted by Jean-Claude Antonio <jc...@arcetis.com>.
Cheers Steve,

Steven A Rowe a écrit :
> Hi Jean-Claude,
>
> The general@lucene.apache.org list is not subscribed to by very many people (guessing from the very low traffic volume).  Questions like this will get much faster/better responses if sent to java-user@l.a.o.
>
> My guess is that you're using the StandardAnalyzer for querying, but not for indexing.  The StandardAnalyzer includes a stop filter, which by default includes the word "is".  (StandardAnalyzer also downcases words.)  Change the analyzer, or the stop list it uses, so that "is" is not stopped.
>
> Steve 
>
>
> -----Original Message-----
> From: Jean-Claude Antonio [mailto:jcantonio@arcetis.com]
> Sent: Tue 12/18/2007 5:48 AM
> To: general@lucene.apache.org
> Subject: Query issue
>  
> |Hello, I have the following query problem.
>
> With the below code,|| the query
> "\\[prop\\]voila\\:type:RE" works well
> but
> "\\[prop\\]voila\\:type:IS" does not return any value (Hits size is 0)
> The document was though added to the index (I can retrieve the IS 
> document with some other query and the field was well popultated with 
> "IS" value).
> Any clue?
>
>
> ||
> Document doc = new Document();
> doc.add(new Field("[prop]voila:type", "IS", Field.Store.YES, 
> Field.Index.TOKENIZED));
> ...
> writer.addDocument(doc);
>
> doc = new Document();
> doc.add(new Field("[prop]voila:type", "RE", Field.Store.YES, 
> Field.Index.TOKENIZED));
> ...
> writer.addDocument(doc);
>
>
> |
>
>
>   

RE: Query issue

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Jean-Claude,

The general@lucene.apache.org list is not subscribed to by very many people (guessing from the very low traffic volume).  Questions like this will get much faster/better responses if sent to java-user@l.a.o.

My guess is that you're using the StandardAnalyzer for querying, but not for indexing.  The StandardAnalyzer includes a stop filter, which by default includes the word "is".  (StandardAnalyzer also downcases words.)  Change the analyzer, or the stop list it uses, so that "is" is not stopped.

Steve 


-----Original Message-----
From: Jean-Claude Antonio [mailto:jcantonio@arcetis.com]
Sent: Tue 12/18/2007 5:48 AM
To: general@lucene.apache.org
Subject: Query issue
 
|Hello, I have the following query problem.

With the below code,|| the query
"\\[prop\\]voila\\:type:RE" works well
but
"\\[prop\\]voila\\:type:IS" does not return any value (Hits size is 0)
The document was though added to the index (I can retrieve the IS 
document with some other query and the field was well popultated with 
"IS" value).
Any clue?


||
Document doc = new Document();
doc.add(new Field("[prop]voila:type", "IS", Field.Store.YES, 
Field.Index.TOKENIZED));
...
writer.addDocument(doc);

doc = new Document();
doc.add(new Field("[prop]voila:type", "RE", Field.Store.YES, 
Field.Index.TOKENIZED));
...
writer.addDocument(doc);


|