# Search for a keyword in the field in the title, which can occur simultaneously several matching words from the query

**URL:** <https://discuss.elastic.co/t/search-for-a-keyword-in-the-field-in-the-title-which-can-occur-simultaneously-several-matching-words-from-the-query/329608>\
**Category:** Elasticsearch\
**Created:** [April 8, 2023, 10:25am UTC](https://discuss.elastic.co/t/search-for-a-keyword-in-the-field-in-the-title-which-can-occur-simultaneously-several-matching-words-from-the-query/329608 "2023-04-08T10:25:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oleksiiorel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oleksiiorel/32/118205_2.png) [@oleksiiorel](https://discuss.elastic.co/u/oleksiiorel)\
**Post date:** [April 8, 2023, 10:25am UTC](https://discuss.elastic.co/t/search-for-a-keyword-in-the-field-in-the-title-which-can-occur-simultaneously-several-matching-words-from-the-query/329608/1 "2023-04-08T10:25:38Z")

</div>

I want to find blenders in elastic of a certain name & color and brand. To do this, specify 3 fields for the search, specifying in which field elastic should start the search. Elastic returns products that I have not searched for.  
Request length can be any, for example, I decided to find blenders in black color of a certain brand but the query can include anything.

```auto
POST products/_search 
{
  "_source": ["Title","Brand", "SKU", "Color"], //which field do I want to get in result json
    "query": {
        "multi_match" : {
            "query" : "blender hendi black", // input query
            "fields": ["Brand","Title", "Color"], //search fields
            "minimum_should_match": "2", // I also tried query without this attribute
            "fuzziness": 1 //misspelling // I also tried query without this attribute
        }
    },
    "size": 10
}

```

```auto
Elastic result:
There are only two objects in this example, and I check the whole response, it will very often contain products that are not relevant

{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 3,
      "relation": "eq"
    },
    "max_score": 10.110109,
    "hits": [
      {
        "_index": "products",
        "_id": "2ymTUYcBoby_8DNrw9q0",
        "_score": 10.110109,
        "_ignored": [
          "event.original.keyword",
          "Long_description.keyword"
        ],
        "_source": {
          "Brand": "saro",
          "Title": "Cup blender black 2 L, 0.95 kW",
          "Color": "Black",
          "SKU": "329-20151"
        }
      },
      {
        "_index": "products",
        "_id": "sCmSUYcBoby_8DNr4WZp",
        "_score": 9.749819,
        "_ignored": [
          "event.original.keyword"
        ],
        "_source": {
          "Brand": "hendi",
          "Title": "Replacement die for Hendi sealing machine made of polished aluminum Black silicone gasket",
          "Color": "Silver",
          "SKU": "HEN-805589"
        }
      }
      }
    ]
  }
}

```

I understand why elastic finds products that are not blenders, because in the title occurs the name of the color and the product brand name, which turns out to be a match for the two words from the query. How can I solve this problem? How to make elastic return only what I expect?

```auto
I did not change anything in the mapping it created itself

{
  "products": {
    "mappings": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "@version": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Color": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Brand": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "Title": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },

```

I didn't change the standard mapping. I keep all products in the same index. Although I have quite different products with a different number of fields, is it ok to store different entities in the same index, is it ok at all? I couldn't find a specific answer

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 6, 2023, 10:26am UTC](https://discuss.elastic.co/t/search-for-a-keyword-in-the-field-in-the-title-which-can-occur-simultaneously-several-matching-words-from-the-query/329608/2 "2023-05-06T10:26:17Z")

</div>

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