lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1500) Highlighter throws StringIndexOutOfBoundsException
Date Wed, 25 Feb 2009 18:17:02 GMT


Michael McCandless commented on LUCENE-1500:

The thing is, since it's an unchecked exception, you could be well
into production, serving searches, etc, when suddenly unexpectedly
this exception kills the entire search request.  It's brittle.

(vs highlighting the wrong parts but still providing search results to
the user -- graceful degradation).

So I'm still torn on "brittle" (what we have now) vs "graceful"
(current "workaround" patch) handling.  For exceptions that can strike
arbitrarily deep into production/searching, I usually lean towards
being "graceful".

Or... maybe we could introduce a new exception to call this case out
(IncorrectTokenOffsetsException or something?), but: we make it a
checked exception so at compile time you need to handle it?

(I still don't like that we only catch the error intermittantly... but there's
nothing we could really do about that, so javadocs should spell that

> Highlighter throws StringIndexOutOfBoundsException
> --------------------------------------------------
>                 Key: LUCENE-1500
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/highlighter
>    Affects Versions: 2.4
>         Environment: Found this running the example code in Solr (latest version).
>            Reporter: David Bowen
>            Assignee: Michael McCandless
>             Fix For: 2.4.1, 2.9
>         Attachments: LUCENE-1500.patch, patch.txt
> Using the canonical Solr example (ant run-example) I added this document (using exampledocs/
> <add><doc>
>   <field name="id">Test for Highlighting StringIndexOutOfBoundsExcdption</field>
>   <field name="name">Some Name</field>
>   <field name="manu">Acme, Inc.</field>
>   <field name="features">Description of the features, mentioning various things</field>
>   <field name="features">Features also is multivalued</field>
>   <field name="popularity">6</field>
>   <field name="inStock">true</field>
> </doc></add>
> and then the URL http://localhost:8983/solr/select/?q=features&hl=true&hl.fl=features
caused the exception.
> I have a patch.  I don't know if it is completely correct, but it avoids this exception.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message