Returning field values in percolator response

Hello,

My initial post ended up subjectless which is hard to follow.
http://elasticsearch-users.115913.n3.nabble.com/no-subject-td3136838.html

So I am repeating the use case in a separate thread.

Percolator response includes only names of the queries that matched are returned.

Use case is to add meta-data like fields (e.g. owner of the query) to the registered queries. And retrieve those fields in the percolator response and take some action according to their values.

If there is not a workaround for this, what do you think adding an option to return field values in Percolator response?

For example, the following command would return name of the mathced query (kuku) and value of the color field (green), in the percolator response.

curl -XGET localhost:9200/test/type1/_percolate?fields=color -d '{
"doc" : {
"field1" : "value1"
}
}'

P.S. Currently I am issuing an extra second query to percolator index to retive field values:

curl -XGET 'localhost:9200/_percolator/myindex/kuku?pretty=true&fields=color'

Thanks,
Ahmet

I think I understand better the question, you mean you want to get the percolated query that was registered, not just its name (mostly metadata associated with it). So, yea, there is no support for that, but, in master, there is a new multi get API that will make this faster.

On Wednesday, July 6, 2011 at 10:50 PM, Ahmet Arslan wrote:

Hello,

My initial post ended up subjectless which is hard to follow.
http://elasticsearch-users.115913.n3.nabble.com/no-subject-td3136838.html

So I am repeating the use case in a separate thread.

Percolator response includes only names of the queries that matched are returned.

Use case is to add meta-data like fields (e.g. owner of the query) to the registered queries. And retrieve those fields in the percolator response and take some action according to their values.

If there is not a workaround for this, what do you think adding an option to return field values in Percolator response?

For example, the following command would return name of the mathced query (kuku) and value of the color field (green), in the percolator response.

curl -XGET localhost:9200/test/type1/_percolate?fields=color -d '{
"doc" : {
"field1" : "value1"
}
}'

P.S. Currently I am issuing an extra second query to percolator index to retive field values:

curl -XGET 'localhost:9200/_percolator/myindex/kuku?pretty=true&fields=color'

Thanks,
Ahmet

Hi Shay,

Yes you understood correctly. So you are recommending to use new multi get api instead of trying to modify PercolatorResponse?

Thanks,
Ahmet

--- On Thu, 7/7/11, Shay Banon shay.banon@elasticsearch.com wrote:

From: Shay Banon shay.banon@elasticsearch.com
Subject: Re: returning field values in percolator response
To: users@elasticsearch.com
Date: Thursday, July 7, 2011, 5:17 PM

            I think I understand better the question, you mean you want to get the percolated query that was registered, not just its name (mostly metadata associated with it). So, yea, there is no support for that, but, in master, there is a new multi get API that will make this faster.

            
            
            
            On Wednesday, July 6, 2011 at 10:50 PM, Ahmet Arslan wrote:
                Hello,

My initial post ended up subjectless which is hard to follow.
http://elasticsearch-users.115913.n3.nabble.com/no-subject-td3136838.html

So I am repeating the use case in a separate thread.

Percolator response includes only names of the queries that matched are returned.

Use case is to add meta-data like fields (e.g. owner of the query) to the registered queries. And retrieve those fields in the percolator response and take some action according to their values.

If there is not a workaround for this, what do you think adding an option to return field values in Percolator response?

For example, the following command would return name of the mathced query (kuku) and value of the color field (green), in the percolator response.

curl -XGET localhost:9200/test/type1/_percolate?fields=color -d '{
"doc" : {
"field1" : "value1"
}
}'

P.S. Currently I am issuing an extra second query to percolator index to retive field values:

curl -XGET 'localhost:9200/_percolator/myindex/kuku?pretty=true&fields=color'

Thanks,
Ahmet

For now, yes, use the multi get API on the matches you get back.

On Friday, July 8, 2011 at 2:36 PM, Ahmet Arslan wrote:

Hi Shay,

Yes you understood correctly. So you are recommending to use new multi get api instead of trying to modify PercolatorResponse?

Thanks,
Ahmet

--- On Thu, 7/7/11, Shay Banon <shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)> wrote:

From: Shay Banon <shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)>
Subject: Re: returning field values in percolator response
To: users@elasticsearch.com (mailto:users@elasticsearch.com)
Date: Thursday, July 7, 2011, 5:17 PM

I think I understand better the question, you mean you want to get the percolated query that was registered, not just its name (mostly metadata associated with it). So, yea, there is no support for that, but, in master, there is a new multi get API that will make this faster.

On Wednesday, July 6, 2011 at 10:50 PM, Ahmet Arslan wrote:

Hello,

My initial post ended up subjectless which is hard to follow.
http://elasticsearch-users.115913.n3.nabble.com/no-subject-td3136838.html

So I am repeating the use case in a separate thread.

Percolator response includes only names of the queries that matched are returned.

Use case is to add meta-data like fields (e.g. owner of the query) to the registered queries. And retrieve those fields in the percolator response and take some action according to their values.

If there is not a workaround for this, what do you think adding an option to return field values in Percolator response?

For example, the following command would return name of the mathced query (kuku) and value of the color field (green), in the percolator response.

curl -XGET localhost:9200/test/type1/_percolate?fields=color -d '{
"doc" : {
"field1" : "value1"
}
}'

P.S. Currently I am issuing an extra second query to percolator index to retive field values:

curl -XGET 'localhost:9200/_percolator/myindex/kuku?pretty=true&fields=color'

Thanks,
Ahmet