lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Outar" <>
Subject RE: Querying Question
Date Thu, 03 Apr 2003 22:33:57 GMT
RepositoryIndexAnalyzer :

     * Creates a TokenStream which tokenizes all the text in the provided
     * Default implementation forwards to tokenStream(Reader) for
     * with older version. Override to allow Analyzer to choose strategy
     * on document and/or field.
     * @param field is the name of the field
     * @param reader is the data
     * @return a token stream
     * @build 10
    public TokenStream tokenStream(String field, final Reader reader) {

        // do not tokenize any field
        TokenStream t = new CharTokenizer(reader) {
            protected boolean isTokenChar(char c) {
                return true;

        //case insensitive search
        t = new LowerCaseFilter(t);
        return t;


but earlier when I did a query case became an issue I am not sure why as the
analyzer should have lowercased the token but it did not.



-----Original Message-----
From: Eric Isakson []
Sent: Thursday, April 03, 2003 5:23 PM
To: Lucene Users List
Subject: RE: Querying Question

This query.toLowerCase() lowercased your query to become:

name:\"checkpoint\" and  value:\"filenane_1\"

The keyword AND must be uppercase when the query parser gets a hold of it.

If your RepositoryIndexAnalyzer lowercases its tokens you don't need to do
query.toLowerCase(). If it doesn't lowercase its tokens, you may want to
modify it so that it does.


-----Original Message-----
From: Rob Outar []
Sent: Thursday, April 03, 2003 5:11 PM
To: Lucene Users List
Subject: Querying Question
Importance: High

Hi all,

	I am a little fuzzy on complex querying using AND, OR, etc..  For example:

I have the following name/value pairs

file 1 = name = "checkpoint" value = "filename_1"
file 2 = name = "checkpoint" value = "filename_2"
file 3 = name = "checkpoint" value = "filename_3"
file 4 = name = "checkpoint" value = "filename_4"

I ran the following Query:

name:\"checkpoint\" AND  value:\"filenane_1\"

Instead of getting back file 1, I got back all four files?

Then after trying different things I did:

+("name:\"checkpoint\") AND  +(value:\"filenane_1\")

it then returned file 1.

Our project queries solely on name value pairs and we need the ability to
query using AND, OR, NOTS, etc..  What the correct syntax for such queries?

The code I use is :
 QueryParser p = new QueryParser("",
 new RepositoryIndexAnalyzer());
 this.query = p.parse(query.toLowerCase());
 Hits hits =;

Thanks as always,


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

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

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

View raw message