Ошибка запроса Lucene: ArrayIndexOutOfBoundsException - PullRequest
0 голосов
/ 05 декабря 2011

Я использую Solandra (Solr 3.4 + Cassandra 1.0.3), делаю несколько запросов:

Правильные ответы с запросами:

q=text:("LG"+"Nokia"+"Samsung")&fq=creation_date:[1221743600000+TO+1323039600000]&rows=1

q=text:("LG"+"Nokia"+"Samsung")&fq=creation_date:[1221743600000+TO+1323039600000]&rows=1

Ошибка с запросом:

q=text:("LG"+"Nokia"+"Samsung")&fq=creation_date:[1321743600000+TO+1323039600000]&rows=1

Трассировка стека:

ERROR 11:04:58,437 java.lang.ArrayIndexOutOfBoundsException: 4
    at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java:310)
    at org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:47)
    at org.apache.lucene.search.IndexSearcher.searchWithFilter(IndexSearcher.java:572)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:532)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:320)
    at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1278)
    at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1158)
    at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:358)
    at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:261)
    at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
    at solandra.SolandraDispatchFilter.execute(SolandraDispatchFilter.java:171)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
    at solandra.SolandraDispatchFilter.doFilter(SolandraDispatchFilter.java:137)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:322)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Различия: [ 1221743600000 + TO + 1323039600000] и [ 1321743600000 + TO + 1323039600000] ИЛИ строки = 1 и строки = 0

Определение индекса:

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="docs" version="1.2">
    <types>
        <fieldType name="byte" class="solr.ByteField" omitNorms="true"/>
        <fieldType name="short" class="solr.ShortField" omitNorms="true"/>
        <fieldType name="int" class="solr.IntField" omitNorms="true"/>
        <fieldType name="long" class="solr.LongField" omitNorms="true"/>
        <fieldType name="double" class="solr.DoubleField" omitNorms="true"/>
        <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
        <fieldType name="text" class="solr.TextField">
            <analyzer type="index">
                <tokenizer class="solr.StandardTokenizerFactory" />
                <filter class="solr.TrimFilterFactory" />
                <filter class="solr.LowerCaseFilterFactory" />
                <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_pl.txt" />

                <filter class="solr.ReversedWildcardFilterFactory" />
            </analyzer>
            <analyzer type="query">
                <tokenizer class="solr.StandardTokenizerFactory" />
                <filter class="solr.TrimFilterFactory" />
                <filter class="solr.LowerCaseFilterFactory" />
                <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_pl.txt" />
                <!-- filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_pl.txt" enablePositionIncrements="true" / -->
                    <!-- Case insensitive stop word removal.
                    enablePositionIncrements=true ensures that a 'gap' is left to
                    allow for accurate phrase queries.
                    -->
            </analyzer>
        </fieldType>
    </types>
    <fields>
        <field name="id" type="string" indexed="true" stored="true" required="true" />
        <field name="text" type="text" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" required="true" />
        <field name="creation_date" type="long" indexed="true" stored="true" required="true" />
        <dynamicField name="df_b_*" type="byte" indexed="false" stored="true"/>
        <dynamicField name="df_s_*" type="short" indexed="false" stored="true"/>
        <dynamicField name="df_i_*" type="int" indexed="false" stored="true"/>
        <dynamicField name="df_l_*" type="long" indexed="false" stored="true"/>
        <dynamicField name="df_d_*" type="double" indexed="false" stored="true"/>
        <dynamicField name="df_str_*" type="string" indexed="false" stored="true"/>
        <dynamicField name="df_txt_*" type="text" indexed="false" stored="true"/>
    </fields>
    <uniqueKey>id</uniqueKey>
    <defaultSearchField>text</defaultSearchField>
</schema>

Что может быть не такв моих запросах или индексах?

...