I am having a problem creating a percolator. I feel that I am doing everything according to the docs, so help would be appreciated.
The root of my issue is I cant create a percolator document. The put is like this:
git:(master) 3M ®[assets]$ http PUT http://elastic-1:9200/idx-edm-v5/.percolator/2 < sample_percolate.json
HTTP/1.1 500 Internal Server Error
Content-Length: 221
Content-Type: application/json; charset=UTF-8
{
"error": "PercolatorException[[idx-edm-v5] failed to parse query [2]]; nested: QueryParsingException[[idx-edm-v5] Strict field resolution and no field mapping can be found for the field with name [price]]; ",
"status": 500
}
Where sample_percolate.json looks like:
{
"type": "saved-search",
"account": "01P_KBhB4UMnjZLSjhV4NG--/forms~rwp-1839",
"query": {
"filtered": {
"query": [
{
"match_all": {}
}
],
"filter": {
"and": [
{
"range": {
"price": {
"gte": 100000
}
}
},
{
"range": {
"price": {
"lte": 150000
}
}
}
]
}
}
}
}
I use this exact query in the _search endpoint and it works fine, so I am trying to use the same format for the percolate.
I already have a mapping defined, which is quite large, but here I show that the index has a mapping called listing, with a field called price, which is a long
git:(master) 4M ®[assets]$ http GET http://elastic-1:9200/idx-edm-v5/_mapping/listing/field/price
HTTP/1.1 200 OK
Content-Length: 107
Content-Type: application/json; charset=UTF-8
{
"idx-edm-v5": {
"mappings": {
"listing": {
"price": {
"full_name": "price",
"mapping": {
"price": {
"type": "long"
}
}
}
}
}
}
}
My version of elasticsearch
{
"status" : 200,
"name" : "Raving Beauty",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.5.0",
"build_hash" : "544816042d40151d3ce4ba4f95399d7860dc2e92",
"build_timestamp" : "2015-03-23T14:30:58Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
Can someone help me understand what I am doing wrong?