Just to add: basically any value of "hits" that I percolate the return says
is matches the 1-9 range above.
On Thursday, April 26, 2012 10:19:44 AM UTC-4, jschelle wrote:
I'm trying to use the Percolate features. It seems to work fine for text,
but when I try a range query with numeric values I get odd behavior. Every
document seems to have the same query and it shouldn't! Can anyone see
what I'm doing wrong?
//create index
$ curl -XPUT localhost:9200/jperctest3
{"ok":true,"acknowledged":true}
//insert a bunch of queries to the percolator
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":50,"to":75,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"QMQ3mo_8RSWidcFOgbdxGg","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":50,"to":60,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"omenhMF5QDaD6LGORa38wg","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":5,"to":20,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"mhsSnSNgQR6fGysbCHNAkw","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":1,"to":9,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"WopYvt70TqOkd-9CngZivQ","_version":1}
//now add documents
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":30}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":4}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":0}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":-1}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":-10000000}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
On Thursday, April 26, 2012 10:19:44 AM UTC-4, jschelle wrote:
I'm trying to use the Percolate features. It seems to work fine for text,
but when I try a range query with numeric values I get odd behavior. Every
document seems to have the same query and it shouldn't! Can anyone see
what I'm doing wrong?
//create index
$ curl -XPUT localhost:9200/jperctest3
{"ok":true,"acknowledged":true}
//insert a bunch of queries to the percolator
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":50,"to":75,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"QMQ3mo_8RSWidcFOgbdxGg","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":50,"to":60,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"omenhMF5QDaD6LGORa38wg","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":5,"to":20,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"mhsSnSNgQR6fGysbCHNAkw","_version":1}
$ curl -XPOST 'http://localhost:9200/_percolator/jperctest3/' -d
'{"query":{"range":{"hits":{"from":1,"to":9,"include_lower":true,"include_upper":true}}}}'
{"ok":true,"_index":"_percolator","_type":"jperctest3","_id":"WopYvt70TqOkd-9CngZivQ","_version":1}
//now add documents
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":30}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":4}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":0}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":-1}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}
$ curl -XGET localhost:9200/jperctest3/site/_percolate -d
'{"doc":{"hits":-10000000}}'
{"ok":true,"matches":["WopYvt70TqOkd-9CngZivQ"]}