ElasticSearch match query to field that contains number


(timpamungkas) #1

In my data, I have field name that contains values like this

  • 1234_Customer xxx
  • 2345_Customer yyy
  • 5678_Customer zzz

When I'm trying to do match query with text, it works

{
    "query": {
        "match": {
            "name": {
                "query": "customer",
                "operator": "and"
            }
        }
    }
}

But when I'm trying to find using number at front (it's a customer ID), nothing shown up

{
    "query": {
        "match": {
            "name": {
                "query": "123",
                "operator": "and"
            }
        }
    }
}

Is there something else to do before querying? Or I need to use different query?
I think it has something to do with pattern, since between number and first word is _ (underscore)?

Thank you


(Pranav) #2

Could you please provide your mapping file.
Have you used any type of analyzers?


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.