Index: cswordmoduleinfo.cpp =================================================================== --- cswordmoduleinfo.cpp (revision 1010) +++ cswordmoduleinfo.cpp (working copy) @@ -307,13 +307,15 @@ //index the key lucene_utf8towcs(wcharBuffer, key->getText(), BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnIndexed(_T("key"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("key"), wcharBuffer, lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_NO))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("key"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_NO))); + // index the main text //at this point we have to make sure we disabled the strongs and the other options //so the plain filters won't include the numbers somehow. lucene_utf8towcs(wcharBuffer, (const char*) textBuffer.append(m_module->StripText()), BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnStored(_T("content"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("content"), wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("content"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + textBuffer.resize(0); //clean up // index attributes @@ -325,7 +327,8 @@ attListI++) { lucene_utf8towcs(wcharBuffer, attListI->second["body"], BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnStored(_T("footnote"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("footnote"), wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("footnote"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + } // for attListI // Headings @@ -334,7 +337,8 @@ attValueI++) { lucene_utf8towcs(wcharBuffer, attValueI->second, BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnStored(_T("heading"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("heading"), wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("heading"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + } // for attValueI // Strongs/Morphs @@ -345,13 +349,15 @@ if (attListI->second["LemmaClass"] == "strong") { lucene_utf8towcs(wcharBuffer, attListI->second["Lemma"], BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnStored(_T("strong"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("strong"), wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("strong"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + //qWarning("Adding strong %s", attListI->second["Lemma"].c_str()); } if (attListI->second.find("Morph") != attListI->second.end()) { lucene_utf8towcs(wcharBuffer, attListI->second["Morph"], BT_MAX_LUCENE_FIELD_LENGTH); //doc->add(*lucene::document::Field::UnStored(_T("morph"), wcharBuffer)); - doc->add(*(new lucene::document::Field(_T("morph"), wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + doc->add(*(new lucene::document::Field( (const TCHAR *)_T("morph"), (const TCHAR *) wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED))); + } } // for attListI @@ -427,7 +433,7 @@ lucene::analysis::standard::StandardAnalyzer analyzer( stop_words ); lucene::search::IndexSearcher searcher(getModuleStandardIndexLocation().toAscii().constData()); lucene_utf8towcs(wcharBuffer, searchedText.toUtf8().constData(), BT_MAX_LUCENE_FIELD_LENGTH); - boost::scoped_ptr q( lucene::queryParser::QueryParser::parse(wcharBuffer, _T("content"), &analyzer) ); + boost::scoped_ptr q( lucene::queryParser::QueryParser::parse( (const TCHAR*) wcharBuffer, (const TCHAR*) _T("content"), &analyzer) ); boost::scoped_ptr h( searcher.search(q.get(), lucene::search::Sort::INDEXORDER) ); @@ -440,7 +446,7 @@ for (int i = 0; i < h->length(); ++i) { doc = &h->doc(i); - lucene_wcstoutf8(utfBuffer, doc->get(_T("key")), BT_MAX_LUCENE_FIELD_LENGTH); + lucene_wcstoutf8(utfBuffer, (const wchar_t *) doc->get((const TCHAR*) _T("key")), BT_MAX_LUCENE_FIELD_LENGTH); swKey->setText(utfBuffer);