lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Query not finding indexed data
Date Mon, 16 Oct 2006 08:24:57 GMT

On Oct 16, 2006, at 2:44 AM, Antony Bowesman wrote:

> Doron Cohen wrote:
>> Hi Antony, you cannot instruct the query parser to do that. Note  
>> that an
> Thanks, I suspected as much.  I've changed it to make the field  
> tokenized.
>> field name. This is an application logic to know that a certain  
>> query is
>> not to be tokenized. In this case you could create your query with:
>>   query = new TermQuery(fieldName, "IqTstAdminGuide2.pdf");
> The query is user driven, so I can't know without parsing whether  
> it should be tokenised or not.  I would have to extend the parser  
> to make use of TermQuery - it's easier just to tokenize the field  
> now I understand Lucene's behaviour.

You can also use PerFieldAnalyzerWrapper as the analyzer for  
QueryParser, and for all your untokenized fields, specify a  
KeywordAnalyzer.  That will keep untokenized fields from being split  
(as best it can given QueryParser meta-syntax).


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

View raw message