Ruggiero Spearman
Ruggiero Spearman

Reputation: 6905

Wildcard for terms in phrase - Lucene

Google's query syntax allows to search phrases like "as * as a skyscraper" where the asterisk can match any term (or terms). Is there a way to achieve the same thing in Lucene? The proximity operator ~ could be of use but it is not what I exactly want.

Upvotes: 2

Views: 1428

Answers (1)

Yuval F
Yuval F

Reputation: 20621

Try a SpanNearQuery. Mark Miller's SpanQuery Blog Post explains how to use it, and the examples are similar to what you describe.

Upvotes: 1

Related Questions