CottageLabs/whatid — Issue #4: Certain identifiers cause an ES exception
Author: emanuil-tolev
Created: 2012-01-22 18:01:46+00:00
State: open

Try identifying "-" (dash) without the quotes on the web front-end. ElasticSearch tries to parse the dash and throws an exception. The query needs to be escaped, in some way.

Only relevant thing I found was this ElasticSearch issue: https://github.com/elasticsearch/elasticsearch/issues/41

Which means that ES should allow escaping. As far as I understand, that would work by adding a field to the query_string JSON object, escape: true or escape: 1. Trouble is, I'm not sure how to modify the query_string JSON object - it seems to me that dao.DomainObject.query() just takes q="string", gives it to pyes, pyes turns this into a query_string object with the "query" field set to "string". Just can't quite grasp how to add "escape": "true" in this flow.

Any help? Looking at the pyes pydoc didn't yield an unexpected revelation...