[Xapian-discuss] gettting single term search to work with python bindings ( using xapian-core-0.9.2_svn6532, xapian-bindings-0.9.2_svn6532 )

jarrod roberson jarrod.roberson at gmail.com
Fri Jan 20 20:28:04 GMT 2006


I am sorry I broke the reply thread, but your response didn't get to my
mailbox, I saw it on GMANE.

Olly Betts <olly <at> survex.com> writes:

>
> The search script looks plausible.  I think if you actually add some
> postings it'll all start to work.
>
> Cheers,
>     Olly
>

Thanks for the pointers, according to the delve tool I am getting terms
added
from the add_posting() and the data is there, but I can't get the search to
work. Here is my REALLY simple search since I only want to search on a
single term!

#!/usr/bin/python
import sys
import xapian

if len(sys.argv) < 3:
    print >> sys.stderr, "usage: %s <path to database> <search terms>" %
sys.argv[0]
    sys.exit(1)

try:
    database = xapian.Database( sys.argv[1] )

    enquire = xapian.Enquire(database)
    query = xapian.Query( sys.argv[2] )
    print "Performing query `%s'" % query.get_description()

    enquire.set_query(query)
    matches = enquire.get_mset(0, 10)

    print "%i results found" % matches.get_matches_estimated()
    for match in matches:
        print "ID %i %i%% [%s]" % (match[ xapian.MSET_DID],
match[xapian.MSET_PERCENT], match[xapian.MSET_DOCUMENT].get_data())

except Exception, e:
    print "Exception: %s" % str(e)
    sys.exit(1)

Here is what delve tells me:

>delve -r 999 -d /tmp/index
Data for record #999:
/wfs/R/t/3/Rt3oxJib36zNefmMEqJ9FVNyCUE=/SecUpd2005-006Ti.info
/d647d4a0-57c0-11da-be78-080020b7eac9

Term List for record #999: d647d4a0-57c0-11da-be78-080020b7eac9

and here is what my searcher.py program tells me:

>searcher.py /tmp/index d647d4a0-57c0-11da-be78-080020b7eac9
Performing query `Xapian::Query(d647d4a0-57c0-11da-be78-080020b7eac9)'
0 results found

any ideas what I am missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20060120/a6c4a80a/attachment.htm


More information about the Xapian-discuss mailing list