-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch '5.x' into 6.x
# Conflicts: # composer.json
- Loading branch information
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
Documentation in progress... | ||
# Span Near Query | ||
|
||
> More info about span near query is in the [official elasticsearch docs][1] | ||
Matches spans which are near one another. One can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order. The span near query maps to Lucene SpanNearQuery. Here is an example: | ||
|
||
## Simple example | ||
|
||
```JSON | ||
{ | ||
"query": { | ||
"span_near" : { | ||
"clauses" : [ | ||
{ "span_term" : { "field" : "value1" } }, | ||
{ "span_term" : { "field" : "value2" } }, | ||
{ "span_term" : { "field" : "value3" } } | ||
], | ||
"slop" : 12, | ||
"in_order" : false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
In DSL: | ||
|
||
```php | ||
$search = new Search(); | ||
$spanNearQuery = new SpanNearQuery(); | ||
$spanNearQuery->addQuery(new SpanTermQuery('field', 'value1')); | ||
$spanNearQuery->addQuery(new SpanTermQuery('field', 'value2')); | ||
$spanNearQuery->addQuery(new SpanTermQuery('field', 'value3')); | ||
$spanNearQuery->addParameter('slop', 12); | ||
$spanNearQuery->addParameter('in_order', false); | ||
$search->addQuery($spanNearQuery); | ||
|
||
$queryArray = $search->toArray(); | ||
``` | ||
|
||
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-near-query.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters