Hi Emerson!

2011/5/26 Emerson Espínola <emersonespin...@gmail.com>
>
> void Index::NewDoc (const char *contents)

Using "char" here means that you use CLucene in an ASCII mode. Right?

> {
>     Document* doc = _CLNEW Document();
>
>     doc->add(*_CLNEW Field(_T("contents"), _T(contents), Field::STORE_YES | 
> Field::INDEX_TOKENIZED));

"_T(contents)" isn't needed here. Just passing the value of contents
to the Field constructor is sufficient.

>     this->writer->addDocument(doc);
>     _CLDELETE(doc);

As far as I know, writer---or something inside writer---takes
ownership of "doc". So, by deleting it you delete a object that is
still referenced. Maybe this is the reason for you access violation.

> }
>
> Consider this->writer already instanciated in my class Index. I debuged until 
> I couldn't go deeper and O stopped in the line which is throwing the 
> exception: line 282 from DocumentWriter.cpp method invertDocument().
>
> void DocumentWriter::invertDocument(const Document* doc) {
> ...
>     CL_NS(analysis)::TokenStream* stream = analyzer->tokenStream(fieldName, 
> reader);
> ...
> }

Which version of CLucene do you use? I see there an assertion.

Kind regards,

Veit

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to