I have a name field which has string value like
Blue Latest Product (NKK-1294)
Pink Black Product (NKK-1233)
Black Pink Stone (SKK-129)
If I search
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"name": {
"query": "NKK-1233",
"operator":"and"
}
}
}
]
}
}
]
}
}
}
Gives me correct output "Pink Black Product (NKK-1233)"
But when I run
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"name": {
"query": "NKK-12",
"operator":"and"
}
}
}
]
}
}
]
}
}
}
return 0 results but I need
Blue Latest Product (NKK-1294)
Pink Black Product (NKK-1233)
those result ... means I want to apply like query
{
"local": {
"mappings": {
"document": {
"dynamic_templates": [
{
"price_mapping": {
"match": "price_",
"match_mapping_type": "string",
"mapping": {
"store": true,
"type": "float"
}
}
},
{
"position_mapping": {
"match": "position_",
"match_mapping_type": "string",
"mapping": {
"index": false,
"type": "integer"
}
}
},
{
"string_mapping": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"copy_to": "_search",
"index": false,
"type": "text"
}
}
}
],
"properties": {
"_search": {
"type": "text"
},
"name": {
"type": "text"
}
}
}
}
}
}