[Xapian-discuss] Re: searching and sorting by date

Olly Betts olly at survex.com
Thu Mar 30 16:36:29 BST 2006


On Sat, Mar 25, 2006 at 02:43:41PM +0000, James Aylett wrote:
> Attached a patch against svn HEAD - should work against 0.9.4 as well,

I'm a little concerned at the idea of adding piecemeal little extras
like this to particular language bindings.  Once we add something, users
will expect it to remain there and working and we don't want to paint
ourselves into a corner by neglecting the big picture.

I agree that adding wrappers for iterators with the natural semantics of
a particular language is clearly desirable.

But if having Database.enquire() and Database.query() is desirable for
Python then why not for the other bindings, and indeed for the C++ API?

> which also adds documentation for the pythonic iterators.

That's definitely desirable, so I've committed that part.

> > By default in Xapwrap it just prints the score and document id.  You can 
> > access values of the document form the result, so if title was an 
> > existing value:
> > 
> >     print result['values']['title']
> > 
> > would print the title of the matching document.
> 
> I assume that "value" in Xapwrap corresponds to "data field" in
> Xapian.

I think xapwrap abuses document values as general purpose data fields.

As I've pointed out before (most recently earlier today) this isn't
really a good idea.  But I can't force people to believe me...

> This was a little confusing a while ago, when we renamed half
> the concepts around documents - fields are strings with arbitrary
> names, while values are integer-numbered strings. (Values are of very
> specific use; you tend to use fields when displaying stuff about a
> document.)

To my knowledge, we only renamed "keys" to "values" (because key is a
rather overloaded term already).

> +<dt><code>flags</code></dt>
> +<dd>Flags to pass to <code>QueryParser::parser_query()</code>, defaulting to 0 (no flags)</dd>

The default value for the QueryParser flags in C++ isn't 0.

Cheers,
    Olly



More information about the Xapian-discuss mailing list