[Xapian-discuss] Problems with positions and replace_document

Fernando Nemec fernando.nemec at folha.com.br
Mon Nov 13 12:37:20 GMT 2006


Hi Olly,

sorry my delay to reply. I hardly check my messages on the weekend.

> Upon further inspection, I see this is actually a correct fix - the
> key thing is to create the PositionIterator before we delete the old
> positional information. Sorry for not seeing that before.

> But in fact we only need to explicitly delete it if we don't have new
> positional information - if we're replacing the positional information
> it will just overwrite any old information so we can save a Btree
> operation here.

I'm glad to help. If we could have a way to check if the doc already
has a docid... But as far as I dig into the code, a document alone
doesn't know his own docdi, is that right?

I was wondering if I can use docid to bring a new instance of a the
document and, as new documents use reference count, compare this
instance with the one supplied in the argument list. This way, I
think, the method knows if that's a replace or a update operation. The
problem is I don't know how expensive is to do such operation,

If you want me to, perhaps I can try to think in a smarter and faster
way to replace positional information when the Documents involved are
the same.

Thanks again,

Nemec




Sunday, November 12, 2006, 3:12:47 AM, you wrote:

> On Sat, Nov 11, 2006 at 11:08:16AM +0000, Olly Betts wrote:
>> But I don't see that this double call could cause the problem, so I
>> think your patch probably just avoids the bug manifesting rather than
>> fixing it completely.

> Upon further inspection, I see this is actually a correct fix - the key
> thing is to create the PositionIterator before we delete the old
> positional information.  Sorry for not seeing that before.

> But in fact we only need to explicitly delete it if we don't have new
> positional information - if we're replacing the positional information
> it will just overwrite any old information so we can save a Btree
> operation here.

> Quartz has the same problem and InMemory a very similar one, which I've
> produced fixes for.  The remote backend works fine (once the database
> being used by the remote end is fixed).

> Cheers,
>     Olly

--
[]s
Fernando Nemec
fernando.nemec at folha.com.br
http://www.folha.com.br/





More information about the Xapian-discuss mailing list