Hello Milind,
if you don't set the field to be tokenized, no analyzer will be used and
the field's contents will be stored as-is, i.e. case sensitive.
It's the analyzer's job to tokenize the input, so if you use an analyzer
that does not separate the input into several tokens (like the
: Re: Can't get case insensitive keyword analyzer to work
Hello Milind,
if you don't set the field to be tokenized, no analyzer will be used and
the field's contents will be stored as-is, i.e. case sensitive.
It's the analyzer's job to tokenize the input, so if you use an analyzer
that does
Thanks Christoph,
So it seems that tokenized has been conflated to analyzed. I just looked
at the Javadocs and that's what it mentions. I had read it earlier, but it
hadn't registered. I wonder why it's not called setAnalyzed. Thanks again.
On Tue, Aug 12, 2014 at 3:07 AM, Christoph Kaser
It does look like the lowercase is working.
The following code
Document theDoc = theIndexReader.document(0);
System.out.println(theDoc.get(sn));
IndexableField theField = theDoc.getField(sn);
TokenStream theTokenStream = theField.tokenStream(theAnalyzer);
I found the problem. But it makes no sense to me.
If I set the field type to be tokenized, it works. But if I set it to not
be tokenized the search fails. i.e. I have to pass in true to the method.
theFieldType.setTokenized(storeTokenized);
I want the field to be stored as un-tokenized.
I looked at a couple of examples on how to get keyword analyzer to be case
insensitive but I think I missed something since it's not working for me.
In the code below, I'm indexing text in upper case and searching in lower
case. But I get back no hits. Do I need to something more while