Hi, As I wrote in http://trac.xapian.org/wiki/GSoC2014/Posting%20list%20encoding%20improvements/Journal#June4, I am debugging with a test failure. I use gdb to track the process of the test simplequery1, in api_anydb.cc, L170 // tests the document count for a simple query DEFINE_TESTCASE(simplequery1, backend) { Xapian::Enquire enquire(get_database("apitest_simpledata")); enquire.set_query(Xapian::Query("word")); Xapian::MSet mymset = enquire.get_mset(0, 10); TEST_MSET_SIZE(mymset, 2); return true; } I track the process of get_database, and finally arrive at brass_database.cc L121, if (readonly) { open_tables_consistent(0); return; } But I didn't find the code where the files concerning with test simplequery1 get indexed. I think all these failures in tests are due to my change of brass_postlist.cc, maybe something wrong happen about doc length when files get indexed. To repair this bug, I want to find, during the test simplequery1, the exact place where doc length information is indexed to database, but I failed. When I set a break point at L1556 of brass_postlist.cc( the function merge_doclen_changes ), I get (gdb) b brass_postlist.cc:1556 No source file named brass_postlist.cc. ------------------ Shangtong Zhang,Second Year Undergraduate, School of Computer Science, Fudan University, China. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140605/9d13adce/attachment.html>
On Thu, Jun 05, 2014 at 10:46:07AM +0800, Hurricane Tong wrote:> But I didn't find the code where the files concerning with test > simplequery1 get indexed.The code to create a suitable database for the backend we're running the testcase for is in tests/harness/. But I think you might do better to start more simply - for example, try indexing a single document to a brass database: $ rm -rf tmp.db $ echo hello world | XAPIAN_PREFER_BRASS=1 examples/simpleindex tmp.db Then you can look at it with delve: $ bin/xapian-delve tmp.db UUID = 1636c618-30c9-47ac-9cd7-f2073a18136f number of documents = 1 average document length = 4 document length lower bound = 4 document length upper bound = 4 highest document id ever used = 1 has positional information = true (You'll have a different UUID) And dump out the document length list (there's a bug in recent trunk which I've just fixed - if you have assertions on this command will fail, and you'll need the fix from commit 181fcf4): $ bin/xapian-delve tmp.db -t '' -1 -v Posting List for term '' (termfreq 1, collfreq 1, wdf_max 0): 1 1 4 The "-t ''" means "show the doclength postlist"; "-1" means "one entry per line"; "-v" means "show more info". The last column is the doclength (the other two are always 1 for the doclength postlist). It is 4 because we index each term both stemmed and unstemmed. If that works, try it with a second document: $ rm -rf tmp.db $ printf 'hello world\n\nsecond doc' | XAPIAN_PREFER_BRASS=1 examples/simpleindex tmp.db And so on...> but I failed. > When I set a break point at L1556 of brass_postlist.cc( the function merge_doclen_changes ), > I get > (gdb) b brass_postlist.cc:1556 > No source file named brass_postlist.cc.The source file is: backends/brass/brass_postlist.cc Cheers, Olly