You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Jack Krupansky <ja...@basetechnology.com> on 2013/08/04 22:49:30 UTC

Typos in Lucene exceptions for stored term vectors

I stumbled across the following Lucene exceptions that each have the same typo – they do not output a closing quote and parenthesis:

In org.apache.lucene.index.TermVectorsConsumerPerField.start (branch_4x):

    if (field.fieldType().storeTermVectorOffsets()) {
      throw new IllegalArgumentException("cannot index term vector offsets when term vectors are not indexed (field=\"" + field.name());
    }
    if (field.fieldType().storeTermVectorPositions()) {
      throw new IllegalArgumentException("cannot index term vector positions when term vectors are not indexed (field=\"" + field.name());
    }
    if (field.fieldType().storeTermVectorPayloads()) {
      throw new IllegalArgumentException("cannot index term vector payloads when term vectors are not indexed (field=\"" + field.name());
    }
  }
} else {
  if (field.fieldType().storeTermVectors()) {
    throw new IllegalArgumentException("cannot index term vectors when field is not indexed (field=\"" + field.name());
  }
  if (field.fieldType().storeTermVectorOffsets()) {
    throw new IllegalArgumentException("cannot index term vector offsets when field is not indexed (field=\"" + field.name());
  }
  if (field.fieldType().storeTermVectorPositions()) {
    throw new IllegalArgumentException("cannot index term vector positions when field is not indexed (field=\"" + field.name());
  }
  if (field.fieldType().storeTermVectorPayloads()) {
    throw new IllegalArgumentException("cannot index term vector payloads when field is not indexed (field=\"" + field.name());
  }

Change:

(field=\"" + field.name()

to

(field=\"" + field.name() + "\")"

The specific exception I got from Solr:

24671 [qtp22111754-10] ERROR org.apache.solr.servlet.SolrDispatchFilter  – null:java.lang.IllegalArgumentException: cannot index term vector positions when term vectors are not indexed (field="term_pos
        at org.apache.lucene.index.TermVectorsConsumerPerField.start(TermVectorsConsumerPerField.java:86)


-- Jack Krupansky

Re: Typos in Lucene exceptions for stored term vectors

Posted by Michael McCandless <lu...@mikemccandless.com>.
Thanks Jack!  I'll fix ...

Mike McCandless

http://blog.mikemccandless.com


On Sun, Aug 4, 2013 at 4:49 PM, Jack Krupansky <ja...@basetechnology.com> wrote:
> I stumbled across the following Lucene exceptions that each have the same
> typo – they do not output a closing quote and parenthesis:
>
> In org.apache.lucene.index.TermVectorsConsumerPerField.start (branch_4x):
>
>     if (field.fieldType().storeTermVectorOffsets()) {
>       throw new IllegalArgumentException("cannot index term vector offsets
> when term vectors are not indexed (field=\"" + field.name());
>     }
>     if (field.fieldType().storeTermVectorPositions()) {
>       throw new IllegalArgumentException("cannot index term vector positions
> when term vectors are not indexed (field=\"" + field.name());
>     }
>     if (field.fieldType().storeTermVectorPayloads()) {
>       throw new IllegalArgumentException("cannot index term vector payloads
> when term vectors are not indexed (field=\"" + field.name());
>     }
>   }
> } else {
>   if (field.fieldType().storeTermVectors()) {
>     throw new IllegalArgumentException("cannot index term vectors when field
> is not indexed (field=\"" + field.name());
>   }
>   if (field.fieldType().storeTermVectorOffsets()) {
>     throw new IllegalArgumentException("cannot index term vector offsets
> when field is not indexed (field=\"" + field.name());
>   }
>   if (field.fieldType().storeTermVectorPositions()) {
>     throw new IllegalArgumentException("cannot index term vector positions
> when field is not indexed (field=\"" + field.name());
>   }
>   if (field.fieldType().storeTermVectorPayloads()) {
>     throw new IllegalArgumentException("cannot index term vector payloads
> when field is not indexed (field=\"" + field.name());
>   }
>
> Change:
>
> (field=\"" + field.name()
>
> to
>
> (field=\"" + field.name() + "\")"
>
> The specific exception I got from Solr:
>
> 24671 [qtp22111754-10] ERROR org.apache.solr.servlet.SolrDispatchFilter  –
> null:java.lang.IllegalArgumentException: cannot index term vector positions
> when term vectors are not indexed (field="term_pos
>         at
> org.apache.lucene.index.TermVectorsConsumerPerField.start(TermVectorsConsumerPerField.java:86)
>
>
> -- Jack Krupansky

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org