# Exist filter not giving consistent results in version 0.90.6

**URL:** <https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425>\
**Category:** Elasticsearch\
**Created:** [March 18, 2014, 1:28pm UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425 "2014-03-18T13:28:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [March 18, 2014, 1:28pm UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425/1 "2014-03-18T13:28:00Z")

</div>

Hi All,

```
   I need to make a filter query to find how many document are there 

```

with a particular field existing, and its giving me different results every  
time,when I make request to Elasticsearch server. The filter used is

{  
"filter":  
{  
"exists":  
{  
"field":"approved"  
}  
}  
}

The query is being run on a single \_type,with approx 200K documents in it.  
And this issue is there on production server only, locally it is working  
fine. On production we have two server for Elasticsearch distribution.

If anyone having the idea, why is this happening?? Is it a bug or something  
else, that I need to understand, Please help.

Thanks

--  
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/9424a5ba-22e6-4117-bc1d-ecf73570c107%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9424a5ba-22e6-4117-bc1d-ecf73570c107%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 18, 2014, 11:34pm UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425/2 "2014-03-18T23:34:48Z")

</div>

Is it consistent if you specify preference=\_primary in your search request?

GET localhost:9200/\_search?preference=\_primary

If yes, I'd check the logs to see if there was any failures in there  
related to indexing data.

--  
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/39da6568-4972-4e05-89a4-6861569a3157%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/39da6568-4972-4e05-89a4-6861569a3157%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [March 19, 2014, 4:24am UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425/3 "2014-03-19T04:24:31Z")

</div>

Thanks for letting me know the aspect. Currently i am not using preference,  
i will check it and let you know.

On Wednesday, 19 March 2014 05:04:48 UTC+5:30, Binh Ly wrote:

> Is it consistent if you specify preference=\_primary in your search request?
> 
> GET localhost:9200/\_search?preference=\_primary
> 
> If yes, I'd check the logs to see if there was any failures in there  
> related to indexing data.

--  
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/0e87ae04-afbe-4f70-a4b4-846ceaa50cb6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0e87ae04-afbe-4f70-a4b4-846ceaa50cb6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [March 25, 2014, 5:50am UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425/4 "2014-03-25T05:50:00Z")

</div>

Yes, with preference the results are not fluctuating. But i am seeing some  
others issues too, and I feel,they are related somewhere,  
We have some very frequent queries.

# The document is having a field, \*"guid"(type-\>long) \*which is having the

same value as its \*"\_id". \*And this value is assigned externally, So If i  
query a document via \_id, the results were fetched, but if i do the same  
query via guid, the results were empty, The wierd thing is, All this was  
working fine few days ago.

# Currently we are having continuous data writes to ES via scripts, These

scripts suppose to add new documents or to update the existing documents  
via adding new field data or deleting the field data. But I found, The  
deletion of fields via update API is not working. The fields are still  
there. Not sure, if some new document are also being missed in ES ??

So My doubt is, can it be memory issue, or number of files opened or  
something else??

On Wednesday, 19 March 2014 09:54:31 UTC+5:30, Narinder Kaur wrote:

> Thanks for letting me know the aspect. Currently i am not using  
> preference, i will check it and let you know.
> 
> On Wednesday, 19 March 2014 05:04:48 UTC+5:30, Binh Ly wrote:
> 
> > Is it consistent if you specify preference=\_primary in your search  
> > request?
> > 
> > GET localhost:9200/\_search?preference=\_primary
> > 
> > If yes, I'd check the logs to see if there was any failures in there  
> > related to indexing data.

--  
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/8a863062-b559-422a-9ed7-a10a44624c59%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8a863062-b559-422a-9ed7-a10a44624c59%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:40am UTC](https://discuss.elastic.co/t/exist-filter-not-giving-consistent-results-in-version-0-90-6/16425/5 "2017-07-06T01:40:53Z")

</div>


