Skip to content

Cannot search annotations by the uri term #20

@shidh

Description

@shidh

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 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions