On Mon, Jul 2, 2012 at 8:22 AM, Marvin Humphrey <[email protected]> wrote:
> On Mon, Jul 2, 2012 at 6:31 AM, Martin Hebnes Pedersen
> <[email protected]> wrote:
>> So far I've overridden 'new' and 'transform' and indexing seems to work.
>>
>> The problem is that I need some parameters like minLength, but they are not
>> in schema_x.json and My::Analysis::EdgeNGramTokenizer's contructor is never
>> called when I load the IndexSearcher.
>>
>> I have tried to override dump and load, but that only results in segfaults.
>
> I've investigated a bit, and it seems that while overriding dump() works,
> overriding load() fails.

> I'll look deeper and get back to you.

The problem should be fixed by commit r1356440.

  http://svn.apache.org/viewvc?view=revision&revision=1356440
  svn diff -c 1356440 http://svn.apache.org/repos/asf/lucy/trunk

You will also need to override equals() in your Analyzer subclass:

  sub equals {
    my ($self, $other) = @_;
    return 0 unless $other;
    return 0 unless ref($self) eq ref($other);
    return 0 unless $min_length{$$self} == $min_length{$$other};
    return $self->SUPER::equals($other);
  }

Marvin Humphrey

Reply via email to