Query using url with quotes


(Uirá Kulesza) #1

Dear all,

I am trying to submit a Elasticsearch query using the Java API. I have adapted a query originally submitted via Kibana (that works).

The problem seems to be the usage of quotes in one of the filters.

I have printed the query submitted at the end of this message.

Has anybody faced the same problem? Any tip on that.

Many thanks and best regards,

Uirá

{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "*"
}
},
"filter": {
"bool": {
"must": [
{
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "id_sistema:2"
}
},
"$state": {
"store": "appState"
}
},
{
"query": {
"match": {
"url.raw": {
"query": "https://www.mysystem.com/module/javascript/page1.jsp",
"type": "phrase"
}
}
},
"$state": {
"store": "appState"
}
},
{
"range": {
"@timestamp": {
"gte": 1493736110958,
"lte": 1493995310958,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
}
}
},
"aggs": {
"3": {
"filters": {
"filters": {
"id_sistema:2": {
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "id_sistema:2"
}
}
},
"url.raw:"https://www.mysystem.com/module/javascript/page1.jsp"": {
"query": {
"query_string": {
"query": "url.raw:"https://www.mysystem.com/module/javascript/page1.jsp"",
"analyze_wildcard": true
}
}
}
}
},
"aggs": {
"4": {
"terms": {
"field": "url.raw",
"size": 1000,
"order": {
"_count": "desc"
}
},
"aggs": {
"2": {
"percentiles": {
"field": "tempo",
"percents": [
50
]
}
}
}
}
}
}
}
}


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.