I have date field, which is stored with following mapping:
"RecordedDate": {
"type": "string",
"analyzer": "DateAndNumber"
}
Here is analyzer:
"DateAndNumber": {
"pattern": "([/\\-]+)",
"type": "pattern"
}
When I'm searching with following query:
"query": {
"query_string": {
"default_field": "RecordedDate",
"query": "RecordedDate:2\\/2\\/1902",
"default_operator": "and"
}
I've got a lot of irrelevant search results which contains 2 and 1902 terms. E.g: 2/18/1902, 5/2/1902 instead of 2/2/1902.
Is there any way to make the analyzer take term position/offset into account as well?