I have using below Query and i have successfully created index with mapping and setting but i am not getting required result. please help
Below the ES Query
curl -XPUT "
http://localhost:9200/test_index" -d'
{
"settings": {
"analysis": {
"filter": {
"edgeNGram_filter": {
"type": "edgeNGram",
"min_gram": 2,
"max_gram": 20
}
},
"analyzer": {
"edgeNGram_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding",
"edgeNGram_filter"
]
}
}
}
},
"mappings": {
"doc": {
"_all": {
"enabled": true,
"index_analyzer": "edgeNGram_analyzer",
"search_analyzer": "standard"
},
"properties": {
"field1": {
"type": "string",
"include_in_all": true
},
"field2": {
"type": "string",
"include_in_all": true
}
}
}
}
}
'
curl -XPOST "
http://localhost:9200/test_index/doc/" -d'
{"index":{"_id":1}}
{"field1":"purple duck","field2":"brown fox"}'
curl -XPOST "
http://localhost:9200/test_index/doc/" -d'
{"index":{"_id":2}}
{"field1":"slow purple duck","field2":"quick brown fox"}'
curl -XPOST "
http://localhost:9200/test_index/doc/" -d'
{"index":{"_id":3}}
{"field1":"red turtle","field2":"quick rabbit"}'
curl -XPOST "
http://localhost:9200/test_index/_search" -d'
{
"query": {
"match": {
"_all": {
"query": "purp fo slo",
"operator": "and"
}
}
}
}'