# For indexing product attributes, more short text fields vs fewer fields with more words

**URL:** <https://discuss.elastic.co/t/for-indexing-product-attributes-more-short-text-fields-vs-fewer-fields-with-more-words/220548>\
**Category:** Elasticsearch\
**Created:** [February 23, 2020, 12:35pm UTC](https://discuss.elastic.co/t/for-indexing-product-attributes-more-short-text-fields-vs-fewer-fields-with-more-words/220548 "2020-02-23T12:35:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fong\_Ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fong_ng/32/21533_2.png) [@Fong\_Ng](https://discuss.elastic.co/u/Fong_Ng)\
**Post date:** [February 23, 2020, 12:35pm UTC](https://discuss.elastic.co/t/for-indexing-product-attributes-more-short-text-fields-vs-fewer-fields-with-more-words/220548/1 "2020-02-23T12:35:12Z")

</div>

I am planning to use elasticsearch to index product attributes. Each document should have around 60 fixed fields. I was reading the documentation about [tuning for search speed](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-search-speed.html). It mentions that when **query\_string** or **multi\_match** query targets more fields, the performance is slower. Does that statement apply for **match** or **match\_phrase** queries?

**Example**

Query 1:

```
{
  "mappings": {
    "properties": {
      "case_color": {
        "type": "text", // keyword type is not flexible enough in my case
      },
      "case_finish": {
        "type": "text",
      }
    }
  }
}

{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "case_color": {
              "query": "blue"
            }
          }
        },
        {
          "match": {
            "case_finish": {
              "query": "polished"
            }
          }
        }
      ]
    }
  }
}

```

Query 2:

```
{
  "mappings": {
    "properties": {
      "case": {
        "type": "text",
      },
    }
  }
}
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "case": {
              "query": "blue color"
            }
          }
        },
        {
          "match": {
            "case": {
              "query": "polished finish"
            }
          }
        }
      ]
    }
  }
}

```

Is it better to put case color and finish attributes into one big field "case" than splitting them into different fields?

However, by putting all case related attributes into the "case" field, it would contain more words:

```
case: blue color, brushed and matte finish, plastic material

```

By splitting them into different fields, each field will have fewer words:

```
case_color: blue
case_finish: brushed and matte
material: plastic

```

I would like to know which approach is better.

---

<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:** [March 22, 2020, 12:35pm UTC](https://discuss.elastic.co/t/for-indexing-product-attributes-more-short-text-fields-vs-fewer-fields-with-more-words/220548/2 "2020-03-22T12:35:31Z")

</div>

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