lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Lecarme <math...@garambrogne.net>
Subject Re: Questions about use of SpellChecker: Constructor and Simillarity...
Date Tue, 08 Apr 2008 18:03:27 GMT
>> I'm cool :) I just think you are overcomplicating things.
>>
>>
> Yes... I can use two words and OR
> Suposse I query on this
>
> The Lord of Rings: Return of King
> The Lord of Rings: Fellowship
> The Lord of Rings: The Two towers
> The Lord of Weapons
> The Lord of War
>
> Suposse an user search: "The Lord of Rings Return of King"
> WHERE
> name like '%the lord%' or
> name like '%lord of%' or
> name like '%of rings%' or
> name like '%rings return%' or
> name like '%return of%' or
> name like '%of king%'
Lucen syntax is more pretty.
With movie title indexed as "title", with LowerCaseFilter.


BooleanQuery bq = new BooleanQuery();
bd.add(new TermQuery(new Term("title", "the lord")), Occur.SHOULD);
bd.add(new TermQuery(new Term("title", "lord of")), Occur.SHOULD);
bd.add(new TermQuery(new Term("title", "of rings")), Occur.SHOULD);
bd.add(new TermQuery(new Term("title", "rings return")), Occur.SHOULD);
bd.add(new TermQuery(new Term("title", "return of")), Occur.SHOULD);
bd.add(new TermQuery(new Term("title", "of king")), Occur.SHOULD);

> So will show all lines... the question now is which is best  
> 'ranking' ...
> However you all help me so much , THANKS SO MUCH!!!
> (now I won't say bad about the constructor of SpellChecker)
most word matched, the better score you have.
You should use a thresold (number of common words/word size) or  
something like that to exclude to far title.

M.


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


Mime
View raw message