Percolator with scripting

Hi! Seems the script in percolator does not work.

Here is my test:

---------------- mapping --------------------------
http://localhost:9200/test
{
"mappings": {
"event": {
"properties": {
"integer": {
"type": "integer"
}
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": 0
}
}
}

-------------- percolator ----------------------------
http://localhost:9200/_percolator/test/sub-1
{
"query": {
"match": {
"integer": 2
}
},
"script_fields": {
"integer": {
"script": "doc['integer'].value * 2"
}
}
}

------------ percolate---------------------------
http://localhost:9200/test/event/_percolate
{"doc":{"integer":"1"}}

I hope the script will do the work and make the doc like
{"doc":{"integer":"2"}} so that I can get matches. But seems it does not.
Any idea?

Thanks a lot!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

the percolator mechanism allows you to register a query, which is supposed
to match, but not to execute a script against it (as the script_fields
feature is not part of the query phase). Best would be if you do that kind
of calculation upfront and then percolate...

--Alex

On Fri, Aug 2, 2013 at 11:25 PM, Yan Wang ywang4362@gmail.com wrote:

Hi! Seems the script in percolator does not work.

Here is my test:

---------------- mapping --------------------------
http://localhost:9200/test
{
"mappings": {
"event": {
"properties": {
"integer": {
"type": "integer"
}
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": 0
}
}
}

-------------- percolator ----------------------------
http://localhost:9200/_percolator/test/sub-1
{
"query": {
"match": {
"integer": 2
}
},
"script_fields": {
"integer": {
"script": "doc['integer'].value * 2"
}
}
}

------------ percolate---------------------------
http://localhost:9200/test/event/_percolate
{"doc":{"integer":"1"}}

I hope the script will do the work and make the doc like
{"doc":{"integer":"2"}} so that I can get matches. But seems it does not.
Any idea?

Thanks a lot!

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.