Created
September 17, 2021 14:50
-
-
Save Shelob9/dfbd0276c46df86682b1cf12cc429886 to your computer and use it in GitHub Desktop.
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
{ | |
"mapping": { | |
"properties": { | |
"eventType": { | |
"type": "text", | |
"fields": { | |
"keyword": { | |
"type": "keyword", | |
"ignore_above": 256 | |
} | |
} | |
}, | |
"siteId": { | |
"type": "long" | |
}, | |
"siteUrl": { | |
"type": "text", | |
"fields": { | |
"keyword": { | |
"type": "keyword", | |
"ignore_above": 256 | |
} | |
} | |
}, | |
"time": { | |
"type": "date", | |
"format": "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis" | |
} | |
} | |
} | |
} |
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 works: | |
GET team_1/_search | |
{ | |
"query" : { | |
"match" : { | |
"eventType" : "login" | |
} | |
}, | |
"sort": { "time": "desc"} | |
} | |
This errors: | |
GET team_1/_search | |
{ | |
"query" : { | |
"match" : { | |
"eventType" : "login" | |
}, | |
"filter" : { | |
"range" : { | |
"lte" : { | |
"time" : "2021/01/01" | |
} | |
} | |
} | |
}, | |
"sort": { "time": "desc"} | |
} | |
{ | |
"error": { | |
"root_cause": [ | |
{ | |
"type": "parsing_exception", | |
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]", | |
"line": 6, | |
"col": 7 | |
} | |
], | |
"type": "parsing_exception", | |
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]", | |
"line": 6, | |
"col": 7 | |
}, | |
"status": 400 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment