# Filtering different indexes with missing field

**URL:** <https://discuss.elastic.co/t/filtering-different-indexes-with-missing-field/18702>\
**Category:** Elasticsearch\
**Created:** [July 16, 2014, 2:16pm UTC](https://discuss.elastic.co/t/filtering-different-indexes-with-missing-field/18702 "2014-07-16T14:16:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Lima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiago_lima/32/1400_2.png) [@Tiago\_Lima](https://discuss.elastic.co/u/Tiago_Lima)\
**Post date:** [July 16, 2014, 2:16pm UTC](https://discuss.elastic.co/t/filtering-different-indexes-with-missing-field/18702/1 "2014-07-16T14:16:26Z")

</div>

Hi,

I'm trying to filtering two different indexes with the same filter, but one  
of the indexes doesn't have the field that I'm trying to filter:

"mappings":{  
"user":{  
"properties":{  
"inactive":{  
"type":"boolean",  
"index":"not\_analyzed"  
}  
}  
}  
},  
"course":{  
"properties":{  
}  
}  
}

Filtering:  
"filter":{  
"and":[  
{ },  
{  
"term":{  
"inactive":false  
}  
}  
]  
},

But only users is retrieved, how can I apply this filter just for user  
index.

I really appreciate any help.

--  
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/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tiago\_Lima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiago_lima/32/1400_2.png) [@Tiago\_Lima](https://discuss.elastic.co/u/Tiago_Lima)\
**Post date:** [July 16, 2014, 6:45pm UTC](https://discuss.elastic.co/t/filtering-different-indexes-with-missing-field/18702/2 "2014-07-16T18:45:50Z")

</div>

I got the answer, I just have to use the missing filter:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Tiago Ferreira Lima

GitHub: fltiago  
Skype: fltiago  
LinkedIn: [linkedin.com/in/fltiago](http://linkedin.com/in/fltiago)

- 

On Wed, Jul 16, 2014 at 11:16 AM, Tiago Lima [fltiago@gmail.com](mailto:fltiago@gmail.com) wrote:

> Hi,
> 
> I'm trying to filtering two different indexes with the same filter, but  
> one of the indexes doesn't have the field that I'm trying to filter:
> 
> "mappings":{  
> "user":{  
> "properties":{  
> "inactive":{  
> "type":"boolean",  
> "index":"not\_analyzed"  
> }  
> }  
> }  
> },  
> "course":{  
> "properties":{  
> }  
> }  
> }
> 
> Filtering:  
> "filter":{  
> "and":[  
> { },  
> {  
> "term":{  
> "inactive":false  
> }  
> }  
> ]  
> },
> 
> But only users is retrieved, how can I apply this filter just for user  
> index.
> 
> I really appreciate any help.
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/s5eBefaebP0/unsubscribe](https://groups.google.com/d/topic/elasticsearch/s5eBefaebP0/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9c5be39f-b1ab-4cf8-8b11-cca365cd228d%40googlegroups.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/CAFRafxPNRt5nUwvz8NRJoi7%2B-vzi5v2kM8C7Gs9CTWXegbot4g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAFRafxPNRt5nUwvz8NRJoi7%2B-vzi5v2kM8C7Gs9CTWXegbot4g%40mail.gmail.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:15am UTC](https://discuss.elastic.co/t/filtering-different-indexes-with-missing-field/18702/3 "2017-07-06T01:15:22Z")

</div>


