You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Kun Hong <kh...@promptu.com> on 2007/05/01 05:32:50 UTC

Re: Search for docs containing only a certain word in a specified field?


karl wettin wrote:
>
> 30 apr 2007 kl. 02.05 skrev Kun Hong:
>
>>> I'm not sure if you mean that it should treat all repetative tokens 
>>> as only one token? Then you are better of using a filter when 
>>> analyzing text you insert to the index: rather than creating one 
>>> token for each the in "the the the the the the" you only create one. 
>>> You might also want to use this filter when parsing user queries. 
>>> (It will be hard to find the band 'the the'.)
>> I can't just use filters because I have to cater for other titles 
>> that are not just stop words, which
>> should be analyzed normally. (I know this requirement is a bit fussy).
>
> You might want to consider using two fields. One with "normal 
> analysis" and one that filters out everything by titles that contain 
> nothing but one word repeating over and over again. Then it would be 
> sufficient with a single TermQuery to match, and no more need to hack 
> in the extra start- and stop tokens.
>

That's right. I should have think of it.
Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org