I pass the following query with escaped quotation mark:
{
"from": 0,
"size": 100,
"query": {
"query_string": {
"query":
""http://www.ynet.co.il/tags/jQuery16103187891168054193_1379319901404*"*
?"",
"fields": [
"string.VersionId"
]
}
},
"fields": [
"Id",
"string.LocalPath",
"string.VersionId",
"dateTime.CollectionTime"
]
}
and I get the error as if the quotation mark is not escaped:
Caused by: org.elasticsearch.index.query.QueryParsingException:
[monitoredqueries] Failed to parse query
["http://www.ynet.co.il/tags/jQuery16103187891168054193_1379319901404"?"]
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:225)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:193)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:272)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:250)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)
... 12 more
Caused by: org.apache.lucene.queryparser.classic.ParseException: Cannot
parse
'"http://www.ynet.co.il/tags/jQuery16103187891168054193_1379319901404"?"':
Lexical error at line 1, column 72. Encountered: after : ""
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:131)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:213)
... 17 more
the query_string query might not be the best solution for queries like
this, as it is using the lucene query parser (which can easily fail). You
should check out the query DSL a bit further and maybe go with a match
query or a term query - this largely depends how you want to query and what
you are expected and what kind of data you have indexed. Maybe you can
elaborate on that.
I pass the following query with escaped quotation mark:
{
"from": 0,
"size": 100,
"query": {
"query_string": {
"query": "" ynet - תגיות"*
?"",
"fields": [
"string.VersionId"
]
}
},
"fields": [
"Id",
"string.LocalPath",
"string.VersionId",
"dateTime.CollectionTime"
]
}
and I get the error as if the quotation mark is not escaped:
Caused by: org.elasticsearch.index.query.QueryParsingException:
[monitoredqueries] Failed to parse query [" ynet - תגיות]
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:225)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:193)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:272)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:250)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:561)
... 12 more
Caused by: org.apache.lucene.queryparser.classic.ParseException: Cannot
parse '" ynet - תגיות':
Lexical error at line 1, column 72. Encountered: after : ""
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:131)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:213)
... 17 more
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.