Hi -- I've had a test suite running just fine for ages, in which a number
of searches are performed, and return sorted on a listed_at field.
I've had to monkey around with some stuff due to Typhoeus changing how it
handles GET requests (most annoyingly), but the only changes to the queries
I'm running is that they are POSTs rather than GETs, now. The queries have
remained the same.
However, I've now got them all failing with 500s when there are no items to
search on in the index. This never used to happen, I don't think.
Anyway, I looked at the documentation again, and saw the bit about
ignore_unmapped, and thought I'd try that -- but I still get a failure that
complains about the field I'm trying to sort on.
An example query looks like this:
curl -XPOST "http://localhost:9200/my_test_search/items/_search" -d
"{"from":0,"size":60,"sort":{"listed_at":{"order":"desc","ignore_unmapped":true}},"query":{"term":{"category_id":1}}}"
And I get this from the body of the 500 response:
Parse Failure [Failed to parse source
[{"from":0,"size":60,"sort":{"listed_at":{"order":"desc","ignore_unmapped":true}},"query":{"term":{"category_id":1}}}]]];
nested: SearchParseException[[my_test_search][6]: from[0],size[60]: Parse
Failure [No mapping found for [listed_at] in order to sort on]];
}]","status":500
Could anyone advise me as to what I could look into next? I'm totally
stumped.
Cheers,
Doug.
--