# Problems with "filtered"

**URL:** <https://discuss.elastic.co/t/problems-with-filtered/3898>\
**Category:** Elasticsearch\
**Created:** [February 8, 2011, 8:24am UTC](https://discuss.elastic.co/t/problems-with-filtered/3898 "2011-02-08T08:24:14Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Pascal\_P\_Pochet](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@Pascal\_P\_Pochet](https://discuss.elastic.co/u/Pascal_P_Pochet)\
**Post date:** [February 12, 2011, 6:52pm UTC](https://discuss.elastic.co/t/problems-with-filtered/3898/21 "2011-02-12T18:52:07Z")

</div>

Yes, indeed when I start from a fresh copy of ES without any data,  
PUT the mapping I want and PUT INDEX/TYPE/ID data with geoloc  
consistent with the geo\_point feature there is no more problem.  
(I insist on the "consistent": if any geoloc insert is made of data  
that generates an implicit mapping conflicting with what could be a  
geo\_point, then the problem appears again…)

However, the fact the in some situations (still to be reproduced) the  
\_bulk did not generated a default mapping and  
then in that circumstance the "exists" on geoloc worked seems to  
indicate that there is some minor detail that should be  
either documented, either fixed.

Another point to think about is the fact that, when indeed "geoloc" is  
not really a field,  
(and let's forget about the geo\_point context for the purpose here)  
there is no easy way to test for different situations regarding the  
presence of the structured field (empty or not)  
and to test between "struct" : {}, "struct" : null, "struct" :  
{ "field" : "defined" }

PS  
When doing my regression gist, I made a copy-paste mistake that  
reveals another problem:  
I did by mistake a PUT on "INDEX/TYPE/\_count" … which generates an  
entry… now impossible (?) to delete.

On 12 fév, 17:04, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> This happens because the geoloc is not really a field in the document indexed, geoloc.lat and geoloc.lon are (and they are considered as simple numeric values, no geo features enabled). This happens because you did not specify that geoloc is if type "geo\_point" in a mapping (that needs to be specified before indexing a doc). Once you do that, then it will work.
> 
> On Saturday, February 12, 2011 at 5:37 PM, P3 wrote:
> 
> > Here is the gist
> 
> > [Test to demonstrate that filter with "exists" doesn't work correctly once an implicit mapping is created. · GitHub](https://gist.github.com/823820)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 13, 2011, 9:59pm UTC](https://discuss.elastic.co/t/problems-with-filtered/3898/22 "2011-02-13T21:59:42Z")

</div>

If you can recreate the fact that bulk did not create explicit mapping, then I can have a look. Thats right, check for a "struct" using exists is not possible.  
On Saturday, February 12, 2011 at 8:52 PM, P3 wrote:

> Yes, indeed when I start from a fresh copy of ES without any data,  
> PUT the mapping I want and PUT INDEX/TYPE/ID data with geoloc  
> consistent with the geo\_point feature there is no more problem.  
> (I insist on the "consistent": if any geoloc insert is made of data  
> that generates an implicit mapping conflicting with what could be a  
> geo\_point, then the problem appears againâ¦)
> 
> However, the fact the in some situations (still to be reproduced) the  
> \_bulk did not generated a default mapping and  
> then in that circumstance the "exists" on geoloc worked seems to  
> indicate that there is some minor detail that should be  
> either documented, either fixed.
> 
> Another point to think about is the fact that, when indeed "geoloc" is  
> not really a field,  
> (and let's forget about the geo\_point context for the purpose here)  
> there is no easy way to test for different situations regarding the  
> presence of the structured field (empty or not)  
> and to test between "struct" : {}, "struct" : null, "struct" :  
> { "field" : "defined" }
> 
> PS  
> When doing my regression gist, I made a copy-paste mistake that  
> reveals another problem:  
> I did by mistake a PUT on "INDEX/TYPE/\_count" â¦ which generates an  
> entryâ¦ now impossible (?) to delete.
> 
> On 12 fÃ©v, 17:04, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > This happens because the geoloc is not really a field in the document indexed, geoloc.lat and geoloc.lon are (and they are considered as simple numeric values, no geo features enabled). This happens because you did not specify that geoloc is if type "geo\_point" in a mapping (that needs to be specified before indexing a doc). Once you do that, then it will work.
> > 
> > On Saturday, February 12, 2011 at 5:37 PM, P3 wrote:
> > 
> > > Here is the gist
> > 
> > > [Test to demonstrate that filter with "exists" doesn't work correctly once an implicit mapping is created. · GitHub](https://gist.github.com/823820)

---

<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, 4:12am UTC](https://discuss.elastic.co/t/problems-with-filtered/3898/23 "2017-07-06T04:12:09Z")

</div>



[Previous page](https://discuss.elastic.co/t/problems-with-filtered/3898.md?page=1)
