Hi all,
I'm trying to resolve an issue we have where the field has an ampersand.
I did a search on a different field (field_id)and found this document (edited to remove most of it): { "_index": "index_v1", "_type": "item", "_id": "aaaaaaaaa", "_score": 1, "_source": { "field_name": "Testing & Ampersand", "field_id": 1234 } }
It does return the expected results, I think the issue is that our application that builds and sends the request to elastic is escaping the & to &
Is there anything that you know of in the Java SDK that might be doing this kind of escaping automatically? We use the TransportClient so could it be that using HTTP encoding?
I don't think so. But if you are getting this value from a web form coming from an user may be there is some transformation before it actually goes to elasticsearch.
You should get rid of it. Use the Rest client instead.
Thanks David, we are in the process of moving to the REST client instead
You were right on the transformation issue. The frontend was sending it as "&".
I had put some code in to un-escape the & but I was using the wrong decoder (URL not HTML ) , I changed it to a simple replace function and it seems to work now as it sending the corrected value in the request.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.