Skip to content

Is there a QuerParser which can parse query string to SpanNotQuery? #15414

@vsop-479

Description

@vsop-479

Description

It seems org.apache.lucene.queryparser.surround.parser.QueryParser just parse query string to NotQuery (BooleanQuery).

Though ComplexPhraseQueryParser can rewrite query to span queries in some cases. But, must_not clause will be rewritten to ConstantScoreQuery in BooleanQuery#rewrite, rather than a SpanNotQuery in ComplexPhraseQueryParser#rewrite. So, how to write the querystring if we want a SpanNotQuery from ComplexPhraseQueryParser or other QuerParser?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions