Hi Veit.
Thanks for answering.
I figure it out. In my class Index's constructor I created the
StandardAnalyzer, but when the constructor ends its work this variable is
lost, then in some point that I need the analylzer it's not null, however
it's pointing to nowhere.
I moved the analyzer to the scope of class and then everything worked fine.
I'd like to take the advantage of this email to ask two other things:
1. When I get my documents in the Hits object, how do I know how much
similar they are? Using score() method from Hits? Because I passed the same
text that I indexed before and the score of the document was 0.58. I thought
it was strange because I passed the same text used to index it. I'm asking
this because I want to return only documents which are at least 75% similar.
2. I'm indexing portuguese documents. Does it matter? If so, how can I tell
CLucene that I'm indexing/searching portuguese documents.
Thanks in advance for your support.
[]'s
Emerson de Lira Espínola
** <emersonespin...@gmail.com>
<https://profiles.google.com/emersonespinola/buzz?hl=pt-BR>
<http://www.quora.com/emersonespinola>
<http://www.facebook.com/emersonespinola>
<http://www.linkedin.com/in/emersonespinola>
<http://spaces.live.com/profile.aspx?mem=emersonespin...@hotmail.com>
<http://emersonespinola.blogspot.com> <http://twitter.com/emersonespinola>
<http://www.myebook.com/emersonespinola/>
<http://www.myebook.com/emersonespinola/>
2011/5/26 Veit Jahns <nuncupa...@googlemail.com>
> 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
>
------------------------------------------------------------------------------
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