Answer the question
In order to leave comments, you need to log in
elasticsearch. . How to do a search on a field that contains a hyphen?
Good afternoon.
My question is in the title. Example of a field to search for a record: '1111-2222-3333-4444'
Answer the question
In order to leave comments, you need to log in
If you are interested in an analogue of such a request:
Then you must first set the mapping for this field:
curl -XPUT 'http://localhost:9200/index_name/type_name/_mapping' -d '
{
"properties" : {
"field_name" : {"type": "string", "index": "not_analyzed"}
}
}
'
curl -XGET 'http://localhost:9200/index_name/type_name/_search?pretty' -d '{
"filter": {
"term": {
"field_name": "1111-2222-3333-4444"
}
}
}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question