[Xapian-discuss] Searching for numbers?

Olly Betts olly at survex.com
Sat Nov 5 20:33:23 GMT 2005


On Thu, Nov 03, 2005 at 05:29:18PM +0100, Marcus Ramberg wrote:
> Hey, it looks like queries with  numbers return 0 hits in my Xapian
> search database. The query parser seems to handle them allright,
> anyone got a clue why they fail? for example, a search for xbox 360
> or E6 returns 0 hits, and I can easily see I have entries with these
> terms.

The way I'd debug this is to check what QueryParser produces in the
Query object.  Print the string returned by Query::get_description()
which will show the terms in the query.

Then use the delve utility (it's in the examples/ subdirectory of
xapian-core, and should be installed by "make install") to check what
those terms look like in the database.  If you want to poke around to
check what's actually in a database, delve is very handy.

So xbox 360 should parse to: (xbox:(pos=1) OR 360:(pos=2))
(or AND instead of OR depending on the default query operator)

If stem_strategy is STEM_SOME, E6 should parse to: Re6:(pos=1)
otherwise, you should get: e6:(pos=1)

So using delve, inspect the posting list for term "360" like so:

delve -t 360 /path/to/database

Cheers,
    Olly



More information about the Xapian-discuss mailing list