(no subject)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Ahmet Arslan
Hello,

It seems that PercolateResponse returns only the names of the matched queries. There is no built-in way to return fields attached to the registered query. (e.g. color field in examples). Am I correct?

Currently I am issuing an additional get operation (using query name) to retrieve field values (color : blue) .

Is there a better way?

Thanks,
Ahmet
Reply | Threaded
Open this post in threaded view
|

Re: returning field values in percolator response

Ahmet Arslan

> It seems that PercolateResponse returns only the names of
> the matched queries. There is no built-in way to return
> fields attached to the registered query. (e.g. color field
> in examples). Am I correct?
>
> Currently I am issuing an additional get operation (using
> query name) to retrieve field values (color : blue) .
>
> Is there a better way?

I am sorry, I hit the send button accidentally. Without writing the title of the message.
Reply | Threaded
Open this post in threaded view
|

Re:

kimchy
Administrator
In reply to this post by Ahmet Arslan
When you say field values what do you mean? Yea, your assumption is correct, only the queries that matched are returned.

On Monday, July 4, 2011 at 11:06 AM, Ahmet Arslan wrote:

Hello,

It seems that PercolateResponse returns only the names of the matched queries. There is no built-in way to return fields attached to the registered query. (e.g. color field in examples). Am I correct?

Currently I am issuing an additional get operation (using query name) to retrieve field values (color : blue) .

Is there a better way?

Thanks,
Ahmet

Reply | Threaded
Open this post in threaded view
|

Re: returning field values in percolator response

Ahmet Arslan
In reply to this post by Ahmet Arslan
Thanks for the response, Shay.

: When you say field values what do you mean?

I mean the fields attached to the percolator query. For instance
"color" : "blue", in the following example.

curl -XPUT localhost:9200/_percolator/test/kuku -d '{
    "color" : "blue",
    "query" : {
        "term" : {
            "field1" : "value1"
        }
    }
}'

If a document matches the query kuku, I want to retrieve the 'color : blue' as well as 'kuku'.

: Yea, your assumption is
: correct, only the queries that matched are returned.

I have a use-case where I add several fields / meta-data (owner of the query for example) to the queries. I want to return them in the response as well as name of the matching query.

I am going to take some action according to these meta-data like fields.

Do you think is there a workaround to save and retrieve such additional data in Percolator API?

Thanks,
Ahmet