[Xapian-devel] Remote database & local database, and adding new weight found vtable error

林德 leedeetiger at gmail.com
Tue Mar 5 07:54:59 GMT 2013


Hello, guys.
Q1.
now I have load all the docid and its document data into a dictionary for
faster loading data instead of calling
 Xapian::MSetIterator i;
i.get_document().get_data();

but I was happened to discover that the dictionaries got by such two method
were different:

both methods use DB1, DB2

method 1:

Xapian::Database db = Xapian::Database(the path of DB1);
Xapian::Database db2 = Xapian::Database(the path of DB2);

db.add_database(db2);

I pre-load the docid and its document data into dictionary DT1;

method 2:

DB1 and DB2 are opened by Xapian-tcpsrv for remote access.

Xapian::Database dbr = Xapian::Remote::open(host of DB1, port of DB1, 0, 0);
Xapian::Database dbr2 = Xapian::Remote::open(host of DB2, port of DB2, 0,
0);

 db.add_database(dbr2);

Here dictionary DT2 holds the docid and its document data.


=============

Q2.
I want add a weight scheme into Xapian-1.2.12;
I have implemented it by add Myweight.cc in ./weight/ with weight.cc, etc.
and I also added necessary declaration in ./include/xapian/weight.h for
Myweight.

by add Myweight.cc into ./weight/Makefile.am I have successfully compiled
the source code and got the dynamic library.

But when I call Myweight scheme in my own c++ program, the compiler told me
that "undefined reference to 'vtable for Xapian::Myweight'".

I have checked all the virtual function include the destructor and all of
them were re-implemented in Myweight.cc.

Then I replace all the code about TradWeight by Myweight;
and unfortunately all works well by calling "TradWeight" which actually is
implemented Myweight scheme.

I know it maybe not the problem of Xapian but my lack of C++ skills.
It would be nice for all your answers.


-- 
Ronghua Lin
College of Computer Science and Technology, Zhejiang University
Hangzhou, China, 310027
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20130305/b0ee7d6e/attachment.htm>


More information about the Xapian-devel mailing list