lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <DOR...@il.ibm.com>
Subject Re: Applying SpellChecker to a phrase
Date Fri, 07 Dec 2007 20:58:35 GMT
smokey <smokeystu@gmail.com> wrote on 04/12/2007 16:54:32:

> Thanks for the information on o.a.l.search.spans.
>
> I was thinking of parsing the phrase query string into a
> sequence of terms,
> then constructing a phrase query object using add(Term term,
> int position)
> method in org.apache.lucene.search.PhraseQuery class. Then I can inject
> similar words (suggested by SpellChecker) at appropriate
> positions for each
> term as I construct the final phrase query object.
>
> Do you agree that this should work too?

I never tried this but I'm sure it will not work.

The phrase query scorer requires all the terms to
appear - either at the 'right' place or with slop
for sloppy phrases. Therefore if you inject two
terms in the same position the scorer will require
to find both of them in the same position in order to
match a document. This would be an AND logic, while
what you need is an OR logic.

The phrase positions are handy for something else:
supporting searching when stopwords where filtered
(either at indexing or at search or both).

Regards,
Doron


---------------------------------------------------------------------
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