Term(s) Query/Filter : add _index support#7965
Closed
GaelTadh wants to merge 2 commits intoelastic:masterfrom
Closed
Term(s) Query/Filter : add _index support#7965GaelTadh wants to merge 2 commits intoelastic:masterfrom
GaelTadh wants to merge 2 commits intoelastic:masterfrom
Conversation
This commit adds support for _index to the term query, terms query, term filter and terms filter.
All of the below queries work as expected :
```
GET /*/_search
{
"query": {
"term": {
"_index": {
"value": "reddit"
}
}}
}
GET /*/_search
{
"query" :
{
"terms": {
"_index": [
"reddit2"
]
}
}
}
GET /*/_search
{
"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"terms":
{
"_index": [ "reddit"]
}
}
}
}
}
GET /*/_search
{"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": { "_index": { "value": "reddit" }}
}
}
} }
```
Since these are evaluated for each index (to resolve mappings) this change simply tests to see if the index is the correct one and returns a MATCH_ALL or MATCH_NO.
Closes elastic#3316
This commit adds support for _index to the term query, terms query, term filter and terms filter.
All of the below queries work as expected :
```
GET /*/_search
{
"query": {
"term": {
"_index": {
"value": "reddit"
}
}}
}
GET /*/_search
{
"query" :
{
"terms": {
"_index": [
"reddit2"
]
}
}
}
GET /*/_search
{
"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"terms":
{
"_index": [ "reddit"]
}
}
}
}
}
GET /*/_search
{"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": { "_index": { "value": "reddit" }}
}
}
} }
```
Since these are evaluated for each index (to resolve mappings) this change simply tests to see if the index is the correct one and returns a MATCH_ALL or MATCH_NO.
Closes elastic#3316
Contributor
There was a problem hiding this comment.
This is going to break multi-version clusters since we only print the difference from the default mapping in toXContent. I think this should remain true by default and the termQuery/termsFilter methods below should check that the field is indexed AND enabled?
Contributor
|
@GaelTadh I left some (minor) comments |
Contributor
|
This may now be superseded by #12027 which works with the latest master and includes support for Match query etc too. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds support for _index to the term query, terms query, term filter and terms filter.
All of the below queries work as expected :
Since these are evaluated for each index (to resolve mappings) this change simply tests to see if the index is the correct one and returns a MATCH_ALL or MATCH_NO.
Closes #3316