# Strange Behavior with Percolate

**URL:** <https://discuss.elastic.co/t/strange-behavior-with-percolate/53196>\
**Category:** Elasticsearch\
**Created:** [June 17, 2016, 9:45pm UTC](https://discuss.elastic.co/t/strange-behavior-with-percolate/53196 "2016-06-17T21:45:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiago\_sydow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago_sydow/32/6613_2.png) [@thiago\_sydow](https://discuss.elastic.co/u/thiago_sydow)\
**Post date:** [June 17, 2016, 9:45pm UTC](https://discuss.elastic.co/t/strange-behavior-with-percolate/53196/1 "2016-06-17T21:45:07Z")

</div>

Hi!

I'm facing some strange behavior when using percolator. I have 2 requests that gave me different results, even when the document sent was the same.

2016-06-15T17:20:45.763042 - [PERCOLATE-DEBUG] entity\_id=72516902 - returned : ["seg-202024", "seg-257266"]  
2016-06-15T17:21:36.879313 - [PERCOLATE-DEBUG] entity\_id=72516902 - returned : ["seg-202024"]

The document in the first and second time was:

```
{
  "name":"sheyla",
  "job_title":null,
  "created_at":"Tue, 19 Apr 2016 15:13:00 BRT -03:00",
  "updated_at":"Tue, 26 Apr 2016 20:10:41 BRT -03:00",
  "bio":null,
  "opportunity":false,
  "available_for_mailing":true,
  "conversions_sum":1,
  "opportunity_unmarked":false,
  "marked_sale":false,
  "completed_workflows":"[21314]",
  "started_workflows":"[21314]"
}

```

This is the percolated query that is returning incorrectly in the first request (seg-257266):

```
{
  "query":{
    "filtered":{
      "query":{
        "bool":{
          "should":[
            {
              "bool":{
                "must":[
                  {
                    "bool":{
                      "must":{
                        "term":{
                          "marked_sale":true
                        }
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

```

The query executed directly does not return the document in question, so I think that it is OK. Anyone passed through this?

Thanks

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [June 19, 2016, 8:44pm UTC](https://discuss.elastic.co/t/strange-behavior-with-percolate/53196/2 "2016-06-19T20:44:04Z")

</div>

Hey, what ES version are you using? Also can you reproduce the bug in an isolated test case (starting up a local ES, using the mappings/settings from your prod environment and curl requests)?

---

<div class="post-metadata">

**Author:** ![thiago\_sydow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago_sydow/32/6613_2.png) [@thiago\_sydow](https://discuss.elastic.co/u/thiago_sydow)\
**Post date:** [June 20, 2016, 6:26pm UTC](https://discuss.elastic.co/t/strange-behavior-with-percolate/53196/3 "2016-06-20T18:26:32Z")

</div>

Hi Martijn !

The ES version is 2.2, I tried to reproduce both locally and on the same production enviroment but with no success.

I made a script to execute 1.000 requests identical to that, but the problem does not happen.

The stranger is that this continues to happen with different documents, with the same behavior (First time erroneous than all subsequent are fine)

Thanks  
Thiago

---

<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 5, 2017, 10:42pm UTC](https://discuss.elastic.co/t/strange-behavior-with-percolate/53196/4 "2017-07-05T22:42:07Z")

</div>


