lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee <lee...@gmail.com>
Subject Re: [lucy-user] Avoid duplicate docs in hits?
Date Thu, 16 Aug 2012 14:49:14 GMT

On 16/08/2012 16:08, Nick Wellnhofer wrote:
> 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-
Yes, thanks. It would be helpful to have a warning if one attempts to 
create when a directory already exists, but I suppose it might be 
considered redundant: depends how friendly the system should be, I suppose.

Thanks
Lee


Mime
View raw message