Skip to content

Instantly share code, notes, and snippets.

@imotov
Last active September 21, 2023 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imotov/742971eccf8a1d8c04e35a27ca6442e9 to your computer and use it in GitHub Desktop.
Save imotov/742971eccf8a1d8c04e35a27ca6442e9 to your computer and use it in GitHub Desktop.
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