lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aviran" <>
Subject RE: Keyword query confusion
Date Fri, 24 Sep 2004 16:56:34 GMT
The StandardAnalyzer removes the "1" as it is a stop word.
There are two ways you can work around this problem.
1 as you mentioned is to create a Query object programmatically.
2 You can use WhiteSpace Analyzer instead of StandardAnalyzer.


-----Original Message-----
From: Fred Toth [] 
Sent: Friday, September 24, 2004 12:27 PM
Subject: Keyword query confusion

Hi all,

I'm trying to understand what's going on with the query parser and keyword

I've got a large subset of my documents which are "publications". So as to
be able to query these, I've got this in the indexer:

doc.add(Field.Keyword("is_pub", "1"));

However, if I run a query:


I get no hits. If I find a document by other means and dump the fields, the
"is_pub" keyword is there, with value of "1".

Now, I've learned that if I change the field to contain the value "true"
instead of the string "1", this query:


works just fine.

So, I'm pretty sure I'm running afoul of the analyzer, right? The doc says
specifically that I should add keyword query clauses programmatically, and
I'm guessing that's what's wrong.

But can someone explain this? It sure is useful to be able to test this sort
of thing with the query parser. What is going on with the standard analyzer
that makes "true" work and "1" not work?

Is there a way around this other than by writing code to create the query?
This also applies to other types of query, like "pub_date:2004".

Hoping for enlightenment...



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message