Hi everyone
I'm have index with such data
{"id": "some_id",
"owner_id": "some_owner_id",
"created": "{some_creation_date}",
"tag": "some_tag",
"fields":{
{"first_name": "michael",
"last_name":"girnyak",
"name":"michael girnyak",
"phone": "66666666"}
}
{"id": "some_id",
"owner_id": "some_owner_id",
"created": "{some_creation_date}",
"tag": "some_tag",
"fields":{
"first_name": "anton",
"last_name": "koval",
"name": "anton koval",
"phone": "5555555"}
}
{"id": "some_id",
"owner_id": "some_owner_id",
"created": "{some_creation_date}",
"tag": "some_tag",
"fields":{
{"first_name": "brenda",
"last_name":"cristin",
"name":"brenda cristin",
"phone": "77777777"}
}
with mapping such as
{
"contact": {
"_all" : { "enabled" : False },
"_source" : { "enabled" : False },
"properties" : {
"id": {
"type": "string",
"store": "yes"
},
"owner_id": {
"type": "string",
"index": "not_analyzed",
},
"created": {
"type": "date",
"index": "not_analyzed",
"format" : "yyyy-MM-dd'T'HH:mm:ssZ"
},
"tag":{
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": "true",
},
"fields": {
"type": "object",
"properties" : {
"first_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": "true"
},
"last_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": "true"
},
"name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": "true"
},
"phone":
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": "true"
},
}
}
}
and try search by wildcard
{"query": {"wildcard": {"fields.first_name": "a"}}}
I want to have results in this direction
first item with first_name Anton
second item with first_name michAel
third item with first_name brendA
the search criteria must go from start of first_name field to end
what I need to do to get such results?
maybe I need to use some analyzer or some specific boosting
please help me with this I will be very appreciate