Last active
September 21, 2023 15:10
-
-
Save imotov/742971eccf8a1d8c04e35a27ca6442e9 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
DELETE test | |
DELETE test-reindexed | |
PUT test | |
{ | |
"settings": { | |
"number_of_replicas": 0, | |
"number_of_shards": 1 | |
}, | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"text": { | |
"type": "text" | |
} | |
} | |
} | |
} | |
} | |
POST test/_bulk?refresh | |
{"index":{"_type": "_doc"}} | |
{"text": "bazbop-qa-io-135678"} | |
{"index":{"_type": "_doc"}} | |
{"text": "foobop_qa_io_135678"} | |
{"index":{"_type": "_doc"}} | |
{"text": "foobop-qa-io-234567"} | |
{"index":{"_type": "_doc"}} | |
{"text": "foobop qa io 135678"} | |
PUT test-reindexed | |
{ | |
"settings": { | |
"number_of_replicas": 0, | |
"number_of_shards": 1, | |
"analysis": { | |
"analyzer": { | |
"nonsplit_analyzer": { | |
"tokenizer": "standard", | |
"char_filter": [ | |
"nonsplit_char_filter" | |
] | |
} | |
}, | |
"char_filter": { | |
"nonsplit_char_filter": { | |
"type": "mapping", | |
"mappings": [ | |
"- => _" | |
] | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"text": { | |
"type": "text", | |
"analyzer": "nonsplit_analyzer" | |
} | |
} | |
} | |
} | |
} | |
POST _reindex?wait_for_completion=true | |
{ | |
"source": { | |
"index": "test" | |
}, | |
"dest": { | |
"index": "test-reindexed" | |
} | |
} | |
POST test-reindexed/_search | |
{ | |
"query": { | |
"query_string": { | |
"default_field": "text", | |
"query": "*bop-qa-io-135*" | |
} | |
} | |
} | |
POST test-reindexed/_search | |
{ | |
"query": { | |
"query_string": { | |
"default_field": "text", | |
"query": "*bop_qa_io_135*" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment