From: Kostka B. <ko...@to...> - 2013-10-09 18:46:39
|
You should pass dynamically allocated Field object, as you can see e.g. in TestIndexWriter code: doc.add ( *_CLNEW Field(_T("field0"),fld,Field::STORE_YES | Field::INDEX_TOKENIZED) ); Hope this helps Borek From: Michael Zhang (BLOOMBERG/ 731 LEXIN) [mailto:mzh...@bl...] Sent: Wednesday, October 09, 2013 4:38 PM To: clu...@li... Subject: [CLucene-dev] crash -- R6025 pure virtual function call I try to write a test application in Microsoft VS 2010 as following. and when I debug the code, it crash at: writer.addDocument(&doc); and I get an error message, it shows: Runtime Error! Program: C:... R6025 - pure virtual function call Anybody knows how to fix it? Thanks. ___________________________________________________________________ RAMDirectory directory; StandardAnalyzer analyzer; IndexWriter writer(&directory, &analyzer, true); lucene::document::Document doc; doc.add(lucene::document::Field(L"content", L"abcd", lucene::document::Field::STORE_YES| lucene::document::Field::INDEX_TOKENIZED, true)); writer.addDocument(&doc); writer.optimize(); writer.close(); |