lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Wellnhofer <wellnho...@aevum.de>
Subject Re: [lucy-user] Avoid duplicate docs in hits?
Date Thu, 16 Aug 2012 14:08:34 GMT
On 15/08/2012 20:27, Lee wrote:
>
> On 15/08/2012 17:41, Peter Karman wrote:
>> On 8/15/12 2:49 AM, Lee Goddard wrote:
>>> Just started playing with Lucy, but I can't
>>> find a way to prevent duplicate hits
>>> being returned.
>>
>> Lucy won't return duplicate hits. But it also won't prevent you from
>> inserting duplicate documents, for some value of "duplicate".
>>
>> A small, reproducable example is best if you are looking for help.
> Thanks, Peter.
>
> Turned out I solved the problem by removing the index directory before
> re-creating it. I had assumed the 'create' flag would discard any old
> index in the same location.

That's what the "truncate" option is for:

my $indexer = Lucy::Index::Indexer->new(
     index    => $SSS::XXX::Config::LUCY_IDX_PATH,
     create   => 1,
     truncate => 1,
     schema   => $schema,
);

See https://metacpan.org/module/Lucy::Index::Indexer#new-labeled-params-

Nick


Mime
View raw message