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 search annotations by the uri term #20

Open
shidh opened this issue Sep 2, 2014 · 2 comments
Open

Cannot search annotations by the uri term #20

shidh opened this issue Sep 2, 2014 · 2 comments

Comments

@shidh
Copy link

shidh commented Sep 2, 2014

Hi,
i was trying to build my local annotateit, but i found a searching problem:

It works well if i search annotations via term of user, like http://127.0.0.1:5000/api/search?user=admin

if i try to call this url to search by uri http://127.0.0.1:5000/api/search?uri=http://127.0.0.1:5000/user/admin , i got such an exception:

RequestError: TransportError(400, u'SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[PiX76P6FSsenzBNIXsoHSw][annotator][4]: SearchParseException[[annotator][4]: from[-1],size[-1],sort[<custom:"updated": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@7f847be3>]: Parse Failure [Failed to parse source [{"sort": [{"updated": {"order": "asc"}}], "query": {"nested": {"query": {"terms": {"link.href": ["http://127.0.0.1:5000/user/admin"]}}}}}]]]; nested: QueryParsingException[[annotator] [nested] requires \'path\' field]; }{[PiX76P6FSsenzBNIXsoHSw][annotator][1]: SearchParseException[[annotator][1]: from[-1],size[-1],sort[<custom:"updated": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@12d9691f>]: Parse Failure [Failed to parse source [{"sort": [{"updated": {"order": "asc"}}], "query": {"nested": {"query": {"terms": {"link.href": ["http://127.0.0.1:5000/user/admin"]}}}}}]]]; nested: QueryParsingException[[annotator] [nested] requires \'path\' field]; }{[PiX76P6FSsenzBNIXsoHSw][annotator][0]: SearchParseException[[annotator][0]: from[-1],size[-1],sort[<custom:"updated": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@61865cd6>]: Parse Failure [Failed to parse source [{"sort": [{"updated": {"order": "asc"}}], "query": {"nested": {"query": {"terms": {"link.href": ["http://127.0.0.1:5000/user/admin"]}}}}}]]]; nested: QueryParsingException[[annotator] [nested] requires \'path\' field]; }{[PiX76P6FSsenzBNIXsoHSw][annotator][3]: SearchParseException[[annotator][3]: from[-1],size[-1],sort[<custom:"updated": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@3c39179f>]: Parse Failure [Failed to parse source [{"sort": [{"updated": {"order": "asc"}}], "query": {"nested": {"query": {"terms": {"link.href": ["http://127.0.0.1:5000/user/admin"]}}}}}]]]; nested: QueryParsingException[[annotator] [nested] requires \'path\' field]; }{[PiX76P6FSsenzBNIXsoHSw][annotator][2]: SearchParseException[[annotator][2]: from[-1],size[-1],sort[<custom:"updated": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@483de69c>]: Parse Failure [Failed to parse source [{"sort": [{"updated": {"order": "asc"}}], "query": {"nested": {"query": {"terms": {"link.href": ["http://127.0.0.1:5000/user/admin"]}}}}}]]]; nested: QueryParsingException[[annotator] [nested] requires \'path\' field]; }]')

i tried to issue the same query via head(the Elasticsearch plugin) by GET, magically the API responses correct result. But if i use POST, i get the exactly same exception like above.

I cannot find any wrong code which misuse the POST request, please help or any hint 😊

@nickstenning
Copy link
Member

Sorry for the delay in responding -- this looks like a bug in the search action.

@shidh
Copy link
Author

shidh commented Sep 23, 2014

Hi @nickstenning ,
the mapping bug looks like in the dependance package(annotateit/site-packages/annotator), it works well if i create an elasticsearch index via annotator-store and disable annotateit.create_indices(app) in bootstrap.py.

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

2 participants