[Xapian-discuss] Problems with positions and replace_document

Fernando Nemec fernando.nemec at folha.com.br
Fri Nov 10 18:36:31 GMT 2006


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



--
[]s
Fernando Nemec
fernando.nemec at folha.com.br





More information about the Xapian-discuss mailing list