# Weird problems when filtering on the string "?"

**URL:** <https://discuss.elastic.co/t/weird-problems-when-filtering-on-the-string/12697>\
**Category:** Elasticsearch\
**Created:** [July 8, 2013, 11:11am UTC](https://discuss.elastic.co/t/weird-problems-when-filtering-on-the-string/12697 "2013-07-08T11:11:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_van\_der\_Weerd](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Peter\_van\_der\_Weerd](https://discuss.elastic.co/u/Peter_van_der_Weerd)\
**Post date:** [July 8, 2013, 11:11am UTC](https://discuss.elastic.co/t/weird-problems-when-filtering-on-the-string/12697/1 "2013-07-08T11:11:58Z")

</div>

Hi,

In my application (running ES 0.90.1) I fill a field sometimes with "??" to  
indicate no specific value.

During query I do a filter like  
{  
"filter": {  
"term": {  
"lc": "??"  
}  
},  
"query": {  
....  
}

Allthough the query itself has many hits, it returns nothing due to the  
filter. However, many results in the resultset contain "??" is their  
lc-field.  
I can filter on any value, but it seems that only "??" fails.

If I replace the "??" by "\_\_" (both in the query as in the data),  
everything works fine.

I also tried to use a scripted filter like

"filter": {  
"script": {  
"script": "doc['lc'].value =='??'"  
}  
},

It doesn't work either.

Any ideas why this is?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Peter\_van\_der\_Weerd](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Peter\_van\_der\_Weerd](https://discuss.elastic.co/u/Peter_van_der_Weerd)\
**Post date:** [July 8, 2013, 11:46am UTC](https://discuss.elastic.co/t/weird-problems-when-filtering-on-the-string/12697/2 "2013-07-08T11:46:20Z")

</div>

Hola, never mind....

Its a HEAD thingy.  
I did an analyze in HEAD with the "??" and it returned: "jQuery16107912836952600628\_1373270103804"  
as a token...

Thanks,  
Peter

Op maandag 8 juli 2013 13:11:58 UTC+2 schreef Peter van der Weerd het  
volgende:

> Hi,
> 
> In my application (running ES 0.90.1) I fill a field sometimes with "??"  
> to indicate no specific value.
> 
> During query I do a filter like  
> {  
> "filter": {  
> "term": {  
> "lc": "??"  
> }  
> },  
> "query": {  
> ....  
> }
> 
> Allthough the query itself has many hits, it returns nothing due to the  
> filter. However, many results in the resultset contain "??" is their  
> lc-field.  
> I can filter on any value, but it seems that only "??" fails.
> 
> If I replace the "??" by "\_\_" (both in the query as in the data),  
> everything works fine.
> 
> I also tried to use a scripted filter like
> 
> "filter": {  
> "script": {  
> "script": "doc['lc'].value =='??'"  
> }  
> },
> 
> It doesn't work either.
> 
> Any ideas why this is?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:27am UTC](https://discuss.elastic.co/t/weird-problems-when-filtering-on-the-string/12697/3 "2017-07-06T02:27:38Z")

</div>


