Skip to content

[Docs] Clarify span_not query behavior for non-overlapping matches #27150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/reference/query-dsl/span-not-query.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[[query-dsl-span-not-query]]
=== Span Not Query

Removes matches which overlap with another span query. The span not
Removes matches which overlap with another span query. or which are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence full-stop should be replaced by a comma I think.

within x tokens before or y tokens after another SpanQuery. The span not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, having x and y mentioned without later reference is a bit confusing. If this is what pre/post is refering to, I'd either mention those parameters here (e.g. "within a certain amount of tokens (determined by the pre parameter) before") even if that gets a bit longer.

query maps to Lucene `SpanNotQuery`. Here is an example:

[source,js]
Expand Down Expand Up @@ -39,7 +40,7 @@ In the above example all documents with the term hoya are filtered except the on
Other top level options:

[horizontal]
`pre`:: If set the amount of tokens before the include span can't have overlap with the exclude span.
`post`:: If set the amount of tokens after the include span can't have overlap with the exclude span.
`pre`:: If set the amount of tokens before the include span can't have overlap with the exclude span. Defaults to 0.
`post`:: If set the amount of tokens after the include span can't have overlap with the exclude span. Defaults to 0.
`dist`:: If set the amount of tokens from within the include span can't have overlap with the exclude span. Equivalent
of setting both `pre` and `post`.