Hi,
I’ve added the following mapping:
{"user":{"properties":{"name":{"type":"string","store":"yes"},"visits":{"type":"integer","store":"yes"},"comments":{"type":"string","store":"yes"}}}}
And indexing few documents.
Using the java API, I want to add facet FacetBuilders.statisticalFacet(
"facet" ).field( “visits” ), but exception is raised:
[2012-11-29 08:25:34,570][DEBUG][action.search.type ] [Rose] [user][0],
node[pkseu6UeSd-cYlT9kA3bWw], [P], s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@62edc88b]
org.elasticsearch.search.query.QueryPhaseExecutionException: [user][0]:
query[name:"Igor"],from[0],size[10000000]: Query Failed [Failed to execute
main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:198)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
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)
Caused by: java.lang.NumberFormatException: Invalid shift value in
prefixCoded string (is encoded value really an INT?)
at
org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:232)
at org.apache.lucene.search.FieldCache$7.parseInt(FieldCache.java:243)
at
org.elasticsearch.index.field.data.ints.IntFieldData$IntTypeLoader.collectTerm(IntFieldData.java:150)
at
org.elasticsearch.index.field.data.support.FieldDataLoader.load(FieldDataLoader.java:55)
at
org.elasticsearch.index.field.data.ints.IntFieldData.load(IntFieldData.java:135)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:91)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:33)
at org.elasticsearch.index.field.data.FieldData.load(FieldData.java:111)
at
org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:123)
at
org.elasticsearch.search.facet.statistical.StatisticalFacetCollector.doSetNextReader(StatisticalFacetCollector.java:74)
at
org.elasticsearch.search.facet.AbstractFacetCollector.setNextReader(AbstractFacetCollector.java:75)
at
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:67)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:576)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:194)
... 9 more
Did I do something wrong in the mapping? When I run searches without the
facet, SearchHit. sourceAsMap().get( "visits" ) gets this field as Integer.
Thanks.
--