Class SpanMultiTermQueryWrapper<Q extends MultiTermQuery>


  • public class SpanMultiTermQueryWrapper<Q extends MultiTermQuery>
    extends SpanQuery
    Wraps any MultiTermQuery as a SpanQuery, so it can be nested within other SpanQuery classes.

    The query is rewritten by default to a SpanOrQuery containing the expanded terms, but this can be customized.

    Example:

    
     WildcardQuery wildcard = new WildcardQuery(new Term("field", "bro?n"));
     SpanQuery spanWildcard = new SpanMultiTermQueryWrapper<WildcardQuery>(wildcard);
     // do something with spanWildcard, such as use it in a SpanFirstQuery