Is that possible that try to query an empty string in elasticsearch without error? The situation now in my case is there are some words is stored in index, I will receive some data, I want use this kind of data as query data. I can not control the data, so sometimes the data could be empty string. E.g.
query={"query":{"query_stirng":{"query":""}}}
Caused by: org.apache.lucene.queryparser.classic.ParseException: Cannot parse ' ': Encountered "<EOF>" at line 1, column 3.
Was expecting one of:
<NOT> ...
"+" ...
"-" ...
<BAREOPER> ...
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
<REGEXPTERM> ...
"[" ...
"{" ...
<NUMBER> ...
<TERM> ...
"*" ...
at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:126)
at org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:213)
... 15 more
Caused by: org.apache.lucene.queryparser.classic.ParseException: Encountered "<EOF>" at line 1, column 3.
Was expecting one of:
<NOT> ...
"+" ...
"-" ...
<BAREOPER> ...
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
<REGEXPTERM> ...
"[" ...
"{" ...
<NUMBER> ...
<TERM> ...
"*" ...
at org.apache.lucene.queryparser.classic.QueryParser.generateParseException(QueryParser.java:708)
at org.apache.lucene.queryparser.classic.QueryParser.jj_consume_token(QueryParser.java:590)
at org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:275)
at org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:181)
at org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:170)
at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:121)
... 16 more
Is that possible to use elasticsearch to solve this problem or must use code the solve this? So that I can receive the empty data and query with elasticsearch and elasitcsearch will not cause any problem?
Environment : Ubuntu 12.04 desktop 64bit
elasticsearch 0.90.7 >> single node
programming language: python