lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles" <>
Subject Re: Cannot match field containing value "No"
Date Thu, 23 Jan 2003 02:55:49 GMT
Okay please disregard this. Found out that the word "no" is removed by the
StandardAnalyser since its one of the stop words.

----- Original Message -----
From: "Charles" <>
To: <>
Sent: Wednesday, January 22, 2003 6:46 PM
Subject: Cannot match field containing value "No"

Hello all,

I seem to be having trouble matching the value "No". The snippet of my
insert index code looks like this:
IndexWriter writer = new IndexWriter("indexTest", new StandardAnalyzer(),
Document doc = new Document();
doc.add(Field.Text("YesNo", choice));
where the value of the variable choice is either a "Yes" or a "No"
and the code to search it looks like this :

IndexSearcher searcher = new IndexSearcher("indexTest"));
Analyzer analyzer = new StandardAnalyzer();
Query query = org.apache.lucene.queryParser.QueryParser.parse(queryString,
"YesNo", analyzer);
Hits hits =;
System.out.println("Found "+hits.length()+" match");
where the value of queryString contains the user input which is wither a
"Yes" or "No"

Whenever I insert a "No", I would not be able to retrieve it (the output
will show 0 mtaches) even though I use the same analyzer. Any other values
like "Yes","n","y" would get hits.  Has anyone went through similar errors?
Is this a bug or is it some limitation, where lucene can't accept string
values of "No"? Or am i missing something?


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

View raw message