# Why are children of the and-filter cached?

**URL:** https://discuss.elastic.co/t/why-are-children-of-the-and-filter-cached/19645
**Category:** Elasticsearch
**Created:** [September 5, 2014, 1:46pm UTC](https://discuss.elastic.co/t/why-are-children-of-the-and-filter-cached/19645 "2014-09-05T13:46:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Andre\_Hansel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_hansel/32/934_2.png) [@Andre\_Hansel](https://discuss.elastic.co/u/Andre_Hansel)
#### Post date: [September 5, 2014, 1:46pm UTC](https://discuss.elastic.co/t/why-are-children-of-the-and-filter-cached/19645/1 "2014-09-05T13:46:58Z")

</div>

According to

> **[All About Elasticsearch Filter BitSets
	  	 | Elastic](https://www.elastic.co/blog/all-about-elasticsearch-filter-bitsets)**
>
> WARNING: This article contains outdated information. We no longer recommend taking its advice. When building queries in Elasticsearch, you’ll often find yourself composing sets of filters. Say you nee...

  
filters inside an and-filter don't use a BitSet but only check the  
conditions inside the iterated documents.

When I look at the explanation of

GET megacorp/employee/\_search?explain=1  
{  
"query": {  
"filtered": {  
"filter": {  
"and": [  
{ "term": { "age": "25" } },  
{ "term": { "last\_name": "smith" } }  
]  
}  
}  
}  
}

it says:

"\_explanation": {  
"value": 1,  
"description": "ConstantScore(+cache(age:[25 TO 25])  
+cache(last\_name:smith)), product of:",  
"details": [  
{ "value": 1, "description": "boost" }, { "value": 1, "description":  
"queryNorm" }  
]  
}

What does that "cache()" actually mean and how is it beneficial to check  
conditions in each document?

--  
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/5d020da5-f1ea-4250-adc7-50a0efe77db1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5d020da5-f1ea-4250-adc7-50a0efe77db1%40googlegroups.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, 1:04am UTC](https://discuss.elastic.co/t/why-are-children-of-the-and-filter-cached/19645/2 "2017-07-06T01:04:07Z")

</div>


