Query / filter

Hello,
I have a little problem, I don't know how to write query type "or", I want to search 2 printers:
filter looks like this:

{
  "query": {
    "match": {
      "message": {
        "query": "Aficio MP",
        "type": "phrase"
      }
    }
  }
}

I want to add other one, eg. RICOH MP, how should I do that?

As this is more of an Elasticsearch question, I'm moving this post to the Elasticsearch category. If you have a follow up Kibana question, feel free to move the post back to the Kibana category.

You will want to use the bool query, with should. You can read more about it here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html.

according your link I did something like this but it doesn't work, could you correct this?

{
  "bool": {
    "should": [
        {"query": "Aficio MP"},
        {"query": "RICOH MP"}
        ],
  }
}

Try this instead:

{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "message": {
              "query": "Aficio MP",
              "type": "phrase"
            }
          }
        },
        {
          "match": {
            "message": {
              "query": "RICOH MP",
              "type": "phrase"
            }
          }
        }
      ]
    }
  }
}

By the way there is a match_phrase query type that would shorten your query a bit:

{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase": {
            "message": "Aficio MP"
          }
        },
        {
          "match_phrase": {
            "message": "RICOH MP"
          }
        }
      ]
    }
  }
}

Thank you for your help, it works and now I understand how to create other queries.