A Lucene MultiPhraseQuery would work, with each phrase position having two
Terms -- the as-seen word in the query and the term ‘?’.  Performance
wouldn’t be so great given that ‘?’ would appear extremely frequently.  A
variation solving the performance is to use CommonGrams but it would add
some complexity to building the query.

~ David Smiley
Freelance Apache Lucene/Solr Search Consultant/Developer
http://www.linkedin.com/in/davidwsmiley

On Fri, Mar 6, 2015 at 9:19 AM, Robert Stewart <b...@kasisto.com> wrote:

> If I have SOLR document with field value such as:
>
> "a ? c ? e"
>
> And I want a phrase query such as "a b c d e" to match that document.
>
> So:
>
> q:"a b c d e"  --> return doc with "a ? c ? e" as field value for "q"
> field.
>
> Is this possible, or is there a way it can be done with a plug-in using
> lower level Lucene SDK?  Maybe some custom implementation of TermQuery
> where value of "?" always matches any term in the query?
>
> Thanks!
> Robert Stewart
>

Reply via email to