# I am new to Elastic search and trying to fetch data for one of the attribute whose value(lengh \>15)

**URL:** <https://discuss.elastic.co/t/i-am-new-to-elastic-search-and-trying-to-fetch-data-for-one-of-the-attribute-whose-value-lengh-15/294984>\
**Category:** Kibana\
**Created:** [January 20, 2022, 6:57pm UTC](https://discuss.elastic.co/t/i-am-new-to-elastic-search-and-trying-to-fetch-data-for-one-of-the-attribute-whose-value-lengh-15/294984 "2022-01-20T18:57:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anji.nersu](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@anji.nersu](https://discuss.elastic.co/u/anji.nersu)\
**Post date:** [January 20, 2022, 6:57pm UTC](https://discuss.elastic.co/t/i-am-new-to-elastic-search-and-trying-to-fetch-data-for-one-of-the-attribute-whose-value-lengh-15/294984/1 "2022-01-20T18:57:26Z")

</div>

```auto
GET catalog-us/_search
{
  
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "relation_type": {
              "value": "product"
            }
          }
        },
        {
        "filter" : 
          {
            "script" : {
                "script" : "'product.product_id'.values.length > 12"
              
            }
            }
        }
        
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [February 11, 2022, 3:21am UTC](https://discuss.elastic.co/t/i-am-new-to-elastic-search-and-trying-to-fetch-data-for-one-of-the-attribute-whose-value-lengh-15/294984/2 "2022-02-11T03:21:44Z")

</div>

Hi,

Are you still in trouble?  
If so, this page may help you to access data in script.

> **[Accessing document fields and special variables | Elasticsearch Guide \[8.0\] |...](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-fields.html#modules-scripting-doc-vals)**

---

<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 11, 2022, 3:22am UTC](https://discuss.elastic.co/t/i-am-new-to-elastic-search-and-trying-to-fetch-data-for-one-of-the-attribute-whose-value-lengh-15/294984/3 "2022-03-11T03:22:20Z")

</div>

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