What you are looking for is ComplexPhraseQueryParser [1] and implemented in Lucene 2.9.0. It
uses SpanQuery family.
It supports "Phil* PA"~10 as well as "Philadelphid~0.75 PA".
Ranges, OR, fuzzy and wildcard inside proximity (phrases).
[1] http://lucene.apache.org/java/2_9_0/api/contrib-misc/org/apache/lucene/queryParser/complexPhrase/package-summary.html
[2] https://issues.apache.org/jira/browse/LUCENE-1486
> I am trying to figure out a way that I can query a Lucene
> index for a
> phrase but have some fuzziness (edit distance and/or
> wildcard) applied
> to the individual terms. An example should help
> explain what I am
> trying to do:
>
>
>
> Index contains:
>
> Philadelphia PA
>
>
>
> Search is done on:
>
> Philadelphid PA
>
>
>
> I want it to result in a hit - basically something like
> "Philadelphid~0.75 PA" (that syntax is not valid but
> explains what I am
> looking for). Similarly, I would like to be able to
> do something like
> "Phil* PA" and get a hit as well.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
|