# Term filter failed on very long fields

**URL:** <https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658>\
**Category:** Elasticsearch\
**Created:** [November 10, 2014, 8:37am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658 "2014-11-10T08:37:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![limac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limac/32/3981_2.png) [@limac](https://discuss.elastic.co/u/limac)\
**Post date:** [November 10, 2014, 8:37am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658/1 "2014-11-10T08:37:03Z")

</div>

Hi folks,

I was trying to do a term filter on a very long string field, maybe more  
then 500 bytes, but I got 0 hit. So, I am wondering if there is a limitation  
on the length of field while using term filter. The elasticsearch is 1.3.0  
with the map like this :

curl -XPUT '[http://localhost:9200/test/\_mapping/t](http://localhost:9200/test/_mapping/t)' -d '

{

```
"t" : {

    "properties" : {

        "message" : {"type" : "string", "store" : true }

    }

}

```

}

'

For the test, I put a doc into this map first by :

POST /test/t/

{

"message":  
"123456789012345678901234567890123456789012345678901234567890123456789012345  
6789012345678901234567890123456789012345678901234567890123456789012345678901  
2345678901234567890123456789012345678901234567890123456789012345678901234567  
8901234567890123456789012345678901234567890123456789012345678901234567890123  
4567890123456789012345678901234567890123456789012345678901234567890123456789  
0123456789012345678901234567890123456789012345678901234567890123456789012345  
678901234567890123456789012345678901234567890"

}

And then, I tried to search by :

GET test/\_search

{

"from" : 0,

"size" : 20,

"query" : {

```
"filtered" : {

  "query" : {

    "match_all" : { }

  },

  "filter" : {

    "and" : {

      "filters" : [{

        "term" : {

          "message" :

```

"123456789012345678901234567890123456789012345678901234567890123456789012345  
6789012345678901234567890123456789012345678901234567890123456789012345678901  
2345678901234567890123456789012345678901234567890123456789012345678901234567  
8901234567890123456789012345678901234567890123456789012345678901234567890123  
4567890123456789012345678901234567890123456789012345678901234567890123456789  
0123456789012345678901234567890123456789012345678901234567890123456789012345  
678901234567890123456789012345678901234567890"

```
        }

     } ]

    }

  }

}

```

}

}

I got the result:

{

"took": 0,

"timed\_out": false,

"\_shards": {

```
  "total": 1,

  "successful": 1,

  "failed": 0

```

},

"hits": {

```
  "total": 0,

  "max_score": null,

  "hits": []

```

}

}

Any comment will be appreciated, thanks a lot!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [November 10, 2014, 8:53am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658/2 "2014-11-10T08:53:43Z")

</div>

Hello Wang ,

Can you disable analyzer and try again .

Thanks  
Vineeth

On Mon, Nov 10, 2014 at 2:07 PM, Wang Yong [cnwangyong@gmail.com](mailto:cnwangyong@gmail.com) wrote:

> Hi folks,
> 
> I was trying to do a term filter on a very long string field, maybe more  
> then 500 bytes, but I got 0 hit. So, I am wondering if there is a  
> limitation on the length of field while using term filter. The  
> elasticsearch is 1.3.0 with the map like this :
> 
> curl -XPUT '[http://localhost:9200/test/\_mapping/t](http://localhost:9200/test/_mapping/t)' -d '
> 
> {
> 
> ```
> "t" : {
> 
> "properties" : {
> 
> "message" : {"type" : "string", "store" : true }
> 
> }
> 
> }
> 
> ```
> 
> }
> 
> '
> 
> For the test, I put a doc into this map first by :
> 
> POST /test/t/
> 
> {
> 
> "message":  
> "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
> 
> }
> 
> And then, I tried to search by :
> 
> GET test/\_search
> 
> {
> 
> "from" : 0,
> 
> "size" : 20,
> 
> "query" : {
> 
> ```
> "filtered" : {
> 
> "query" : {
> 
> "match_all" : { }
> 
> },
> 
> "filter" : {
> 
> "and" : {
> 
> "filters" : [{
> 
> "term" : {
> 
> "message" :
> 
> ```
> 
> "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
> 
> ```
> }
> 
> } ]
> 
> }
> 
> }
> 
> }
> 
> ```
> 
> }
> 
> }
> 
> I got the result:
> 
> {
> 
> "took": 0,
> 
> "timed\_out": false,
> 
> "\_shards": {
> 
> ```
> "total": 1,
> 
> "successful": 1,
> 
> "failed": 0
> 
> ```
> 
> },
> 
> "hits": {
> 
> ```
> "total": 0,
> 
> "max_score": null,
> 
> "hits": []
> 
> ```
> 
> }
> 
> }
> 
> Any comment will be appreciated, thanks a lot!
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![limac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limac/32/3981_2.png) [@limac](https://discuss.elastic.co/u/limac)\
**Post date:** [November 10, 2014, 9:33am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658/3 "2014-11-10T09:33:23Z")

</div>

Thank you Vineeth, I changed the mapping to :

PUT test/\_mapping/t

{

```
"t" : {

    "properties" : {

        "message" : {"type" : "string", index: "not_analyzed", "store" : true }

    }

}

```

}

And the result is the same.

Wang

From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] On Behalf Of vineeth mohan  
Sent: Monday, November 10, 2014 4:54 PM  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: Re: term filter failed on very long fields

Hello Wang ,

Can you disable analyzer and try again .

Thanks

```
       Vineeth

```

On Mon, Nov 10, 2014 at 2:07 PM, Wang Yong \<[cnwangyong@gmail.com](mailto:cnwangyong@gmail.com) [mailto:cnwangyong@gmail.com](mailto:cnwangyong@gmail.com) \> wrote:

Hi folks,

I was trying to do a term filter on a very long string field, maybe more then 500 bytes, but I got 0 hit. So, I am wondering if there is a limitation on the length of field while using term filter. The elasticsearch is 1.3.0 with the map like this :

curl -XPUT '[http://localhost:9200/test/\_mapping/t](http://localhost:9200/test/_mapping/t)' -d '

{

```
"t" : {

    "properties" : {

        "message" : {"type" : "string", "store" : true }

    }

}

```

}

'

For the test, I put a doc into this map first by :

POST /test/t/

{

"message": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

}

And then, I tried to search by :

GET test/\_search

{

"from" : 0,

"size" : 20,

"query" : {

```
"filtered" : {

  "query" : {

    "match_all" : { }

  },

  "filter" : {

    "and" : {

      "filters" : [{

        "term" : {

          "message" : "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

        }

     } ]

    }

  }

}

```

}

}

I got the result:

{

"took": 0,

"timed\_out": false,

"\_shards": {

```
  "total": 1,

  "successful": 1,

  "failed": 0

```

},

"hits": {

```
  "total": 0,

  "max_score": null,

  "hits": []

```

}

}

Any comment will be appreciated, thanks a lot!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com) [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm_medium=email&utm_source=footer) .  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com) [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com?utm_medium=email&utm_source=footer) .  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/004401cffcc9%2462ce7f80%24286b7e80%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/004401cffcc9%2462ce7f80%24286b7e80%24%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![limac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limac/32/3981_2.png) [@limac](https://discuss.elastic.co/u/limac)\
**Post date:** [November 13, 2014, 2:08am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658/4 "2014-11-13T02:08:09Z")

</div>

Hi all, is there any comment on this issues, is this a bug of elasticsearch. This is really a big problem for me cause we have to query on this big long field!

thank you!

Wang

From: Wang Yong [[mailto:cnwangyong@gmail.com](mailto:cnwangyong@gmail.com)]  
Sent: Monday, November 10, 2014 5:33 PM  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: RE: term filter failed on very long fields

Thank you Vineeth, I changed the mapping to :

PUT test/\_mapping/t

{

```
"t" : {

    "properties" : {

        "message" : {"type" : "string", index: "not_analyzed", "store" : true }

    }

}

```

}

And the result is the same.

Wang

From: [mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] On Behalf Of vineeth mohan  
Sent: Monday, November 10, 2014 4:54 PM  
To: [mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: Re: term filter failed on very long fields

Hello Wang ,

Can you disable analyzer and try again .

Thanks

```
       Vineeth

```

On Mon, Nov 10, 2014 at 2:07 PM, Wang Yong \<[cnwangyong@gmail.com](mailto:cnwangyong@gmail.com) [mailto:cnwangyong@gmail.com](mailto:cnwangyong@gmail.com) \> wrote:

Hi folks,

I was trying to do a term filter on a very long string field, maybe more then 500 bytes, but I got 0 hit. So, I am wondering if there is a limitation on the length of field while using term filter. The elasticsearch is 1.3.0 with the map like this :

curl -XPUT '[http://localhost:9200/test/\_mapping/t](http://localhost:9200/test/_mapping/t)' -d '

{

```
"t" : {

    "properties" : {

        "message" : {"type" : "string", "store" : true }

    }

}

```

}

'

For the test, I put a doc into this map first by :

POST /test/t/

{

"message": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

}

And then, I tried to search by :

GET test/\_search

{

"from" : 0,

"size" : 20,

"query" : {

```
"filtered" : {

  "query" : {

    "match_all" : { }

  },

  "filter" : {

    "and" : {

      "filters" : [{

        "term" : {

          "message" : "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

        }

     } ]

    }

  }

}

```

}

}

I got the result:

{

"took": 0,

"timed\_out": false,

"\_shards": {

```
  "total": 1,

  "successful": 1,

  "failed": 0

```

},

"hits": {

```
  "total": 0,

  "max_score": null,

  "hits": []

```

}

}

Any comment will be appreciated, thanks a lot!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com) [https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/002b01cffcc1%2484429f00%248cc7dd00%24%40gmail.com?utm_medium=email&utm_source=footer) .  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com) [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nC0O%3DD91YMO0mV0YD7k5QKY%2BAZddyVysUapNpGABMMYw%40mail.gmail.com?utm_medium=email&utm_source=footer) .  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/00a501cffee6%24ae4f00a0%240aed01e0%24%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/00a501cffee6%24ae4f00a0%240aed01e0%24%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:50am UTC](https://discuss.elastic.co/t/term-filter-failed-on-very-long-fields/20658/5 "2017-07-06T00:50:21Z")

</div>


