Strange Behavior with Percolate

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

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)?

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