[Xapian-discuss] Problems with positions and replace_document

Fernando Nemec fernando.nemec at folha.com.br
Fri Nov 10 19:09:52 GMT 2006


Hi Rafael, thanks for your reply.

Here you go. I put my code attached to this message.

By the way, I'm using gcc 4.1.1 on Fedora core 4. The flags I'm using
are on the top of program, as well as the path to the db. Also, I'm
using compiled xapian-core 0.9.6 and flint.

Thanks,

Nemec



Friday, November 10, 2006, 4:54:28 PM, you wrote:

> On 11/10/06, Fernando Nemec <fernando.nemec at folha.com.br> wrote:
>>
>> Hi all,
>>
>> I'm currently testing Xapian so I can see if the library fits my
>> needs.
>>
>> While testing I got a small problem.
>>
>> Suppose my database has a document A with two terms "foo" and "bar".
>> "foo" has position 1 and "bar" has position 2.
>>
>> Doing a phrase search for "foo bar", A get matched. So far, so good.
>>
>> Then I apply document A to this process (suppose 1 is A's doc_id):
>>
>> // get document from db add a value put it back
>> Xapian::Document doc = db.get_document( 1 ) ;
>> doc.add_value( 0 , "fnord");
>> db.replace_document( 1 , doc ) ;
>>
>> Well, I'm expecting to have the very same document, but with a new
>> value. Unfortunately, my expectations were wrong. If I try to do the
>> very same phrase search for "foo bar" document A doesn't get matched.
>>
>> Is this behavior by design, consequence of a bug or I'm messing up
>> something?
>>
>> By the way, I wrote a small code to reproduce this behavior. If
>> needed, I can send by request.
>>
>> Thanks,
>>
>> Nemec


> Hi Fernando, you can send attachments to this list, send to us see the code.
> I'll try reproduce the problem using python (more simple ;)

> Thanks.



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


More information about the Xapian-discuss mailing list