Closed syncush closed 5 years ago
See if it works to encode just the query body:
const queryString = JSON.stringify(query).replace(',', '\\,');
const url = `https://mygeoserver.com/geoserver/workspace/wms?........&viewparams=q:${encodeURI(queryString)}`
Hi @sjudeng thank you for your answer but unfortunately, I still get the same error.
I fixed it, I just changed the encodeURI function to encodeURIComponent.
const query = {"terms":{"source": ["1", "2"]}}
const queryString = 'q:' + JSON.stringify(query).replace(',', '\\,');
https://mygeoserver.com/geoserver/workspace/wms?........&viewparams=${encodeURIComponent(queryString)}
Issue can be closed.
Great thank you for reporting back
GeoServer version: v2.15.2 elasticgeo version: v2.15.1-RC1 Elasticsearch version: v6.4.2
I would like to pass a native query to my elasticsearch that uses the terms filter, I have tried the following
my query is :
I have used encodeURI because without it I recieve an error indicating there are invalid characters in my queryString.
The error I receive is the following
Is the error I am receiving is related to directly to elasticgeo? is it possible to use the terms filter in native query?