-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search Relevance/PercolatorReverse search: find queries that match a documentReverse search: find queries that match a document>enhancementTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchhelp wantedadoptmeadoptme
Description
Hey guys,
I was working with the percolator earlier today, and I thought of a nice way to improve its api. So, right now, if I register a query using the percolator:
curl -XPUT localhost:9200/_percolator/test/kuku -d '{
"query" : {
"term" : {
"field1" : "value1"
}
}
}'
and I percolate a matching document
curl -XGET localhost:9200/test/type1/_percolate -d '{
"doc" : {
"field1" : "value1"
}
}'
I get something of the effect back:
{"ok":true, "matches":["kuku"]}
Which a fine way of doing things, but I think it'd be nicer to be able to register metadata along with the query. So, something of the effect:
curl -XPUT localhost:9200/_percolator/test/ -d '{
"query" : {
"term" : {
"field1" : "value1"
}
},
"meta": {
"campaign": 1,
"user_id": 1,
"user_name": kuku
}
}'
If a document matched, I'd get something like this back:
{"ok":true, "matches":[{"_id": "BzA9dR7OSqGylX-0y80IJA", "campaign": 1, "user_id": 1, "user_name": kuku}]}
Currently, if I need to store more information about a query, I need to do hacks, such as concatenating strings with all the information I want to get back from that match (example: "campaign:1-id:1-name:kuku") to use as the id of that document, but that has drawbacks.
What do you guys think?
Metadata
Metadata
Assignees
Labels
:Search Relevance/PercolatorReverse search: find queries that match a documentReverse search: find queries that match a document>enhancementTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchhelp wantedadoptmeadoptme