Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot parse" Exception #812

Closed
caphrim007 opened this issue Mar 29, 2011 · 2 comments
Closed

"Cannot parse" Exception #812

caphrim007 opened this issue Mar 29, 2011 · 2 comments

Comments

@caphrim007
Copy link

I was stumbling my way through querying and ran in to the following exception. I understand that I have no idea what I'm doing here, and was giving it invalid input, but I guess I wasn't expecting an exception.

The query i was using is below

curl -XGET 'http://localhost:9201/default/url/_search?q=latitude:52.0167,asn:20857'

Note the comma in the q= string is, what I believe, causes it to throw the exception.

[2011-03-29 11:26:59,590][DEBUG][action.search.type       ] [Anti-Cap] [default][4], node[0faY_x8CSeqMIPvuHS-IYw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@553b7e18]
org.elasticsearch.search.SearchParseException: [default][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [_na_]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:416)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:332)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:165)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:132)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:76)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.run(TransportSearchTypeAction.java:151)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.elasticsearch.index.query.QueryParsingException: [default] Failed to parse query [latitude:52.0167,asn:20857]
at org.elasticsearch.index.query.xcontent.QueryStringQueryParser.parse(QueryStringQueryParser.java:198)
at org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:167)
at org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:234)
at org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:214)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:34)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:403)
... 10 more
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse 'latitude:52.0167,asn:20857': Encountered " ":" ": "" at line 1, column 20.
Was expecting one of:
<EOF> 
<AND> ...
<OR> ...
<NOT> ...
"+" ...
"-" ...
"(" ...
"*" ...
"^" ...
<QUOTED> ...
<TERM> ...
<FUZZY_SLOP> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...

at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:187)
at org.elasticsearch.index.query.xcontent.QueryStringQueryParser.parse(QueryStringQueryParser.java:192)
... 15 more
Caused by: org.apache.lucene.queryParser.ParseException: Encountered " ":" ": "" at line 1, column 20.
Was expecting one of:
<EOF> 
<AND> ...
<OR> ...
<NOT> ...
"+" ...
"-" ...
"(" ...
"*" ...
"^" ...
<QUOTED> ...
<TERM> ...
<FUZZY_SLOP> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...

at org.apache.lucene.queryParser.QueryParser.generateParseException(QueryParser.java:1759)
at org.apache.lucene.queryParser.QueryParser.jj_consume_token(QueryParser.java:1641)
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1168)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:182)
... 16 more
[2011-03-29 11:27:15,014][INFO ][node                     ] [Anti-Cap] {elasticsearch/0.15.2}[28499]: stopping ...
[2011-03-29 11:27:15,078][INFO ][node                     ] [Anti-Cap] {elasticsearch/0.15.2}[28499]: stopped
@MalkaFeldman
Copy link

I have this error too.

@clintongormley
Copy link

The query syntax parser is strict and is part of lucene - out of our control. Remove the comma and it parses correctly

mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
the ip is now `76.132.96.42`

Approved-by: Gabi Davar
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
This commit fixes issues with supporting Elasticsearch 7.x

This handles the removal of the '_routing' field name and
'_retry_on_conflict' update action aliases in place of 'routing' and
'retry_on_conflict' respectively in Elasticsearch 7.x.

Also fixes integration tests to handle these changes and
the renaming of doc type from 'doc' to '_doc' and the mapping
name change from `_default_` to '_doc'.

Fixes elastic#812
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
Remove unrelated comment from ci/run.sh
Test against 6.0.0 to ensure name changes are correct.

Fixes elastic#812
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
_retry_on_conflict is required for 6.0, allowed for other 6.x,
and forbidden on 7.0
retry_on_conflict is forbidden for 6.0, alllowed for other 6.x,
required for 7.0

Fixes elastic#812
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants