You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Gus Heck <gu...@gmail.com> on 2019/03/06 22:38:15 UTC

PreanalyzeField.createField()

I'm wondering what the logic behind eating this exception might be? Is
there a good reason for it? (I'm having trouble thinking of one)

@Override
public IndexableField createField(SchemaField field, Object value) {
  IndexableField f = null;
  try {
    f = fromString(field, String.valueOf(value));
  } catch (Exception e) {
    log.warn("Error parsing pre-analyzed field '" + field.getName() + "'", e);
    return null;
  }
  return f;
}

It seems to me I'd want to know if the contents of a preanalyzed field were
unparsable every bit as much as I'd want to know about a badly formatted
date? Just came to the realization that a unit test for some code I'm
working was giving false positives...

-Gus

Re: PreanalyzeField.createField()

Posted by Gus Heck <gu...@gmail.com>.
https://issues.apache.org/jira/browse/SOLR-13304

I'll commit in a day or so if nobody chimes in.

On Wed, Mar 6, 2019 at 10:10 PM David Smiley <da...@gmail.com>
wrote:

> That’s nasty; please fix it :-)
>
> On Wed, Mar 6, 2019 at 5:38 PM Gus Heck <gu...@gmail.com> wrote:
>
>> I'm wondering what the logic behind eating this exception might be? Is
>> there a good reason for it? (I'm having trouble thinking of one)
>>
>> @Override
>> public IndexableField createField(SchemaField field, Object value) {
>>   IndexableField f = null;
>>   try {
>>     f = fromString(field, String.valueOf(value));
>>   } catch (Exception e) {
>>     log.warn("Error parsing pre-analyzed field '" + field.getName() + "'", e);
>>     return null;
>>   }
>>   return f;
>> }
>>
>> It seems to me I'd want to know if the contents of a preanalyzed field
>> were unparsable every bit as much as I'd want to know about a badly
>> formatted date? Just came to the realization that a unit test for some code
>> I'm working was giving false positives...
>>
>> -Gus
>>
>>
>> --
> Sent from Gmail Mobile
>


-- 
http://www.the111shift.com

Re: PreanalyzeField.createField()

Posted by David Smiley <da...@gmail.com>.
That’s nasty; please fix it :-)

On Wed, Mar 6, 2019 at 5:38 PM Gus Heck <gu...@gmail.com> wrote:

> I'm wondering what the logic behind eating this exception might be? Is
> there a good reason for it? (I'm having trouble thinking of one)
>
> @Override
> public IndexableField createField(SchemaField field, Object value) {
>   IndexableField f = null;
>   try {
>     f = fromString(field, String.valueOf(value));
>   } catch (Exception e) {
>     log.warn("Error parsing pre-analyzed field '" + field.getName() + "'", e);
>     return null;
>   }
>   return f;
> }
>
> It seems to me I'd want to know if the contents of a preanalyzed field
> were unparsable every bit as much as I'd want to know about a badly
> formatted date? Just came to the realization that a unit test for some code
> I'm working was giving false positives...
>
> -Gus
>
>
> --
Sent from Gmail Mobile