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

Two different indexes with the same nested object name causing ArrayIndexOutOfBoundsException #1575

Closed
jasongilman opened this issue Dec 28, 2011 · 0 comments

Comments

@jasongilman
Copy link

If two different mappings are created within an index that both have a nested object with the same name an ArrayIndexOutOfBoundsException can occur during searches. See this gist to reproduce: https://gist.github.com/1528898

The gist creates an index called main with two mappings alpha and bravo. Alpha and bravo both have a nested object called charlies. The gist indexes two alphas and a bravo. Only the bravo has a nested document. When searching for an alpha using a nested query an ArrayIndexOutOfBoundsException can occur. This error only occurs if the alpha was indexed before the bravo.

This issue is related to the group discussion here: https://groups.google.com/group/elasticsearch/browse_thread/thread/486e7568f82c216a

The stack trace for the exception:

org.elasticsearch.search.query.QueryPhaseExecutionException: [main][1]: query[filtered(ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@91837b24))->FilterCacheFilterWrapper(_type:alpha)],from[0],size[10]: Query Failed [Failed to execute main query]
    at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)
    at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:238)
    at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)
    at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
    at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
    at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
    at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
    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:680)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.apache.lucene.util.OpenBitSetIterator.advance(OpenBitSetIterator.java:166)
    at org.elasticsearch.common.lucene.docset.AndDocIdSet$AndDocIdSetIterator.advance(AndDocIdSet.java:127)
    at org.apache.lucene.search.DeletionAwareConstantScoreQuery$DeletionConstantScorer.advance(DeletionAwareConstantScoreQuery.java:91)
    at org.apache.lucene.search.FilteredQuery$2.score(FilteredQuery.java:157)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:581)
    at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:199)
    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:217)
    ... 9 more
@kimchy kimchy closed this as completed in bb63d38 Dec 28, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
jev001 pushed a commit to jev001/elasticsearch that referenced this issue Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants