ES 6.x...how to get list of percolator queries in an index?

How does one get a list of percolator documents, say with field query in an index?

Since ES 6.x, percolators are kept in same index as those documents they are querying, so I would have assumed I could get all percolator queries in an index like the below...
GET /index/_search
{
"query": {
"bool": {
"must": {
"exists": {
"field": "query"
}
}
}
}
}
But this does not return the percolator queries...the same query above works if I use a field that I have in some documents, like "user"...but I don't want to do a must_not, which works, provided I have a field that every document in the index has, but not the percolator... I just want a query to get all of the percolators in a given index, or shoot, I'd like a query that would just get me all my percolators and I can figure out what /index they are in...

Anyone have any clue how to do this in ES 6.x?

My mappings was created like the below...
PUT /index
{
"mappings": {
"type": {
"properties" : {
"query": {
"type" : "percolator"
}
}
}

I couldn't reproduce on the latest version, which suggests this problem is fixed. Does it work better if you check for existence of query.query_builder_field instead of just query?

Yes! using query.query_builder_field does return the percolators.
I'm using 6.1.1 btw, so definitely not the latest, at least on where I'm testing now, did think of trying the latest, but really thought I was missing something in what I was doing.
Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.