0

I try to write a query where I have multiple Exact search terms lets say an array of strings like

["Q4 Test WC Schüssel", "Q4_18 Bankerlampen", "MORE_SEARCHTERMS"]

And I have an index with an property data.name and I want to search for each of my array strings inside this ONE field for the exact value and I want all entries back where one of my array strings matches.

 {
 "mappings": {
  "_doc": {
    "country": {
      "type": "keyword"
    },
    "data": {
      "properties": {
        "name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword"
            }
          }
        }

I thought this would be an easy task, but I am not shure if I have the wrong google terms where I search for this problem to get an example query.

1 Answer 1

1

Use terms query

GET /_search
{
  "query": {
    "terms": {
      "name.keyword": ["Q4 Test WC Schüssel", "Q4_18 Bankerlampen", "MORE_SEARCHTERMS"]
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.