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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]