Parse Failure [No mapping found for [_uid] in order to sort on]


(Ranjith Venkatesan) #1

Hi,

I am new to ElasticSearch. I am using ElasticSearch 0.90.5 for search module of my application. In my application, i will be using multi-tenant setup with alias for each user. I had a use case such that i want to sort results based on id field. Hence i included sort based on _uid as below

client.prepareSearch(aliases).addSort(SortBuilders.fieldSort("_uid").order(SortOrder.DESC)).setTypes(tableNames);

I am getting exception like below,

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query_fetch], all shards failed; shardFailures {[b98tpRjZTqa1DRJXmXDOAg][29][4]: RemoteTransportException[[node2][inet[/172.20.6.215:9301]][search/phase/query+fetch]]; nested: SearchParseException[[29][4]: from[0],size[5]: Parse Failure [Failed to parse source [{"from":0,"size":5,"filter":{"query":{"field":{"content":"engineer"}}},"sort":[{"_uid":{"order":"asc"}}]}]]]; nested: SearchParseException[[29][4]: from[0],size[5]: Parse Failure [No mapping found for [_uid] in order to sort on]]; }
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:272)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)
at org.elasticsearch.search.action.SearchServiceTransportAction$7.handleException(SearchServiceTransportAction.java:324)
at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:180)
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:170)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:122)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
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:619)

But i am getting results too, not sure whats the problem is.

Thanks in advance

Ranjith Venkatesan


(Roy Krisnadi) #2

I have the same problem here, not sure if this issue has been resolved.

Here's my error
Caused by: org.elasticsearch.search.SearchParseException: [reservenamesearch][1]: from[0],size[1]: Parse Failure [Failed to parse source [{
"from" : 0,
"size" : 1,
"sort" : [ {
"_score" :
{ "order" : "desc" }
,
"_uid" :
{ "order" : "asc" }
} ],
"query" : {
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
"and" : [ {
"term" :
{ "isPendingRegistration" : false }
}, {
"query" : {
"query_string" :
{ "default_field" : "VersionIdentifier", "query" : "T1120938" }
}
} ]
}
}
}
}]]


(system) #3