Mailing List Archive

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 [ In reply to ]
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 [ In reply to ]
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);
>
>
> |
>
>
>