在Elasticsearch中的查询阶段发生了异常QueryPhaseExecutionException

病徵

使用Elasticsearch时,输出了我不熟悉的日志。

[2014-04-12 10:56:19,488][DEBUG][action.search.type       ] [******] [index-name][2], node[******], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3ad22707] lastShard [true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [index-name][2]: query[ConstantScore(*:*)],from[0],size[0]: Query Failed [Failed to execute main query]
        at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:121)
        at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
        at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
        at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:216)
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:203)
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:186)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:701)
Caused by: org.elasticsearch.ElasticSearchException: java.lang.NumberFormatException: Invalid shift value in prefixCoded bytes (is encoded value really an INT?)
        at org.elasticsearch.index.fielddata.AbstractIndexFieldData.load(AbstractIndexFieldData.java:60)
        at org.elasticsearch.index.fielddata.plain.FloatArrayIndexFieldData.load(FloatArrayIndexFieldData.java:41)
        at org.elasticsearch.search.facet.datehistogram.ValueDateHistogramFacetExecutor$Collector.setNextReader(ValueDateHistogramFacetExecutor.java:92)
        at org.elasticsearch.common.lucene.search.FilteredCollector.setNextReader(FilteredCollector.java:68)
        at org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:68)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:612)
        at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:167)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:309)
        at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:105)
        ... 9 more
Caused by: org.elasticsearch.common.util.concurrent.UncheckedExecutionException: java.lang.NumberFormatException: Invalid shift value in prefixCoded bytes (is encoded value really an INT?)
        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
        at org.elasticsearch.common.cache.LocalCache.get(LocalCache.java:3934)
        at org.elasticsearch.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736)
        at org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache$IndexFieldCache.load(IndicesFieldDataCache.java:146)
        at org.elasticsearch.index.fielddata.AbstractIndexFieldData.load(AbstractIndexFieldData.java:53)
        ... 17 more
Caused by: java.lang.NumberFormatException: Invalid shift value in prefixCoded bytes (is encoded value really an INT?)
        at org.apache.lucene.util.NumericUtils.getPrefixCodedIntShift(NumericUtils.java:210)
        at org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder$2.accept(OrdinalsBuilder.java:439)
        at org.apache.lucene.index.FilteredTermsEnum.next(FilteredTermsEnum.java:241)
        at org.elasticsearch.index.fielddata.ordinals.OrdinalsBuilder$3.next(OrdinalsBuilder.java:466)
        at org.elasticsearch.index.fielddata.plain.FloatArrayIndexFieldData.loadDirect(FloatArrayIndexFieldData.java:84)
        at org.elasticsearch.index.fielddata.plain.FloatArrayIndexFieldData.loadDirect(FloatArrayIndexFieldData.java:41)
        at org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache$IndexFieldCache$1.call(IndicesFieldDataCache.java:152)
        at org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache$IndexFieldCache$1.call(IndicesFieldDataCache.java:146)
        at org.elasticsearch.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739)
        at org.elasticsearch.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
        at org.elasticsearch.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
        at org.elasticsearch.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
        at org.elasticsearch.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
        ... 21 more

为什么

在 Elasticsearch 中

    • 同じ index 内の

 

    • 異なる type での

 

    同じ フィールド名

听说有限制。

应对措施

    • フィールドをリネーム

 

    別 index にレコードを作成する

请在汉语中提供以下句子的同义表达:

参考:

    • ElasticSearch Users – Fields with same name mapped differently in different types

 

    Failed to add StatisticalFacet on a integer type field ( NumberFormatException: Invalid shift value in prefixCoded string (is encoded value really an INT?) ) – Google グループ
广告
将在 10 秒后关闭
bannerAds