Tim Underwood wrote:
I'm seeing an java.lang.ArrayIndexOutOfBoundsException when trying to
highlight for certain queries.  The error seems to be an issue with the
combination of the ShingleFilterFactory, PositionFilterFactory and
the LengthFilterFactory.

Here's my fieldType definition:

<fieldType name="textSku" class="solr.TextField" positionIncrementGap="100"
omitNorms="true">
  <analyzer type="index">
    <tokenizer class="solr.KeywordTokenizerFactory" />
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0"
generateNumberParts="0" catenateWords="0" catenateNumbers="0"
catenateAll="1"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    <filter class="solr.LengthFilterFactory" min="2" max="100"/>
  </analyzer>
  <analyzer type="query">
      <tokenizer class="solr.WhitespaceTokenizerFactory" />
      <filter class="solr.ShingleFilterFactory" maxShingleSize="8"
outputUnigrams="true"/>
      <filter class="solr.PositionFilterFactory" />
      <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0"
generateNumberParts="0" catenateWords="0" catenateNumbers="0"
catenateAll="1"/>
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      <filter class="solr.LengthFilterFactory" min="2" max="100"/> <!--
works if this is commented out -->
    </analyzer>
</fieldType>

Here's the field definition:

<field name="sku_new" type="textSku" indexed="true" stored="true"
omitNorms="true"/>

Here's a sample doc:

<add>
    <doc>
      <field name="id">1</field>
      <field name="sku_new">A 1280 C</field>
    </doc>
</add>

Doing a query for "A 1280 C" and requesting highlighting throws the
exception (full stack trace below):

http://localhost:8983/solr/select/?q=sku_new%3A%22A+1280+C%22&version=2.2&start=0&rows=10&indent=on&&hl=on&hl.fl=sku_new&fl=*

If I comment out the LengthFilterFactory from my query analyzer section
everything seems to work.  Commenting out just the PositionFilterFactory
also makes the exception go away and seems to work for this specific query.

Anybody else run into anything similar?  Anything wrong with my fieldType
definition?  Should I file this as a bug with Solr (or Lucene)?

-Tim

ArrayIndexOutOfBoundsException is not good. Please file the issue,
with a minimum data to reproduce the problem would be great help for us. :)

Koji

--
http://www.rondhuit.com/en/

Reply via email to