Hi,

I want to update a document. The document is identified by the document
path e.g. /home/user/file.txt. To find the doc id by the path I need to
assign the path to the document. In the FAQ is supposed to add the doc id
(the path) as a term to the document.

My idea is to at the path as a value by

#define PATH_ID 0
add_value(PATH_ID, "/home/user/file.txt")

and then do a query:

Query (Query::op op_, PATH_ID, "/home/user/file.txt",
"/home/user/file.txt")

Is there a drawback to do such a query on a value? Or is a query on a
value even faster?

thank you
Clemens

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Search Discussions

  • Olly Betts at Nov 21, 2007 at 11:50 pm

    On Mon, Nov 19, 2007 at 07:42:18PM +0100, Clemens Zeidler wrote:
    I want to update a document. The document is identified by the document
    path e.g. /home/user/file.txt. To find the doc id by the path I need to
    assign the path to the document. In the FAQ is supposed to add the doc id
    (the path) as a term to the document.
    Yes, that's how I'd do it.
    My idea is to at the path as a value by

    #define PATH_ID 0
    add_value(PATH_ID, "/home/user/file.txt")

    and then do a query:

    Query (Query::op op_, PATH_ID, "/home/user/file.txt",
    "/home/user/file.txt")
    That code doesn't make sense - I assume you mean to use OP_VALUE_RANGE
    here?
    Is there a drawback to do such a query on a value? Or is a query on a
    value even faster?
    The major drawback is that this will be a lot slower than using a term.

    Cheers,
    Olly
  • Clemens Zeidler at Nov 22, 2007 at 11:49 am
    Hi Olly
    assign the path to the document. In the FAQ is supposed to add the doc
    id
    (the path) as a term to the document.
    Yes, that's how I'd do it.
    But then finding the doc is not 100% unambiguously. Because of this I
    searched for an other solution.
    Query (Query::op op_, PATH_ID, "/home/user/file.txt",
    "/home/user/file.txt")
    That code doesn't make sense - I assume you mean to use OP_VALUE_RANGE
    here?
    Yes sure.
    Is there a drawback to do such a query on a value? Or is a query on a
    value even faster?
    The major drawback is that this will be a lot slower than using a term.
    Ah ok I assumed the same algorithem is used to query the values. And for
    that it would be faster because the number of values is smaller then the
    number of terms.
    Why it is a lot slower? Which algorithem do you use for storing the values?

    thanks
    Clemens



    --
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupxapian-discuss @
categoriesxapian
postedNov 19, '07 at 6:42p
activeNov 22, '07 at 11:49a
posts3
users2
websitexapian.org
irc#xapian

2 users in discussion

Clemens Zeidler: 2 posts Olly Betts: 1 post

People

Translate

site design / logo © 2021 Grokbase