Changed new param name storerawtext->storedoctext. + comments

This commit is contained in:
Jean-Francois Dockes
2018-01-02 19:23:12 +01:00
parent b4493ed9e1
commit bb810f9ceb
7 changed files with 22 additions and 17 deletions
+1 -1
View File
@@ -242,9 +242,9 @@ int Query::Native::abstractFromText(
return ABSRES_ERROR;
}
// tryout the xapian internal method.
#if 0 && ! (XAPIAN_MAJOR_VERSION <= 1 && XAPIAN_MINOR_VERSION <= 2) && \
(defined(RAWTEXT_IN_DATA) || defined(RAWTEXT_IN_VALUE))
// Tryout the Xapian internal method.
string snippet = xmset.snippet(rawtext);
LOGDEB("SNIPPET: [" << snippet << "] END SNIPPET\n");
#endif
+1 -1
View File
@@ -649,7 +649,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
LOGABS("makeAbstract:" << chron.millis() << "mS: mxttloccs " <<
maxtotaloccs << " ctxwords " << ctxwords << "\n");
if (o_index_storerawtext) {
if (o_index_storedoctext) {
return abstractFromText(ndb, docid, matchedTerms, byQ,
totalweight, ctxwords, maxtotaloccs, vabs,
chron);
+6 -4
View File
@@ -794,8 +794,10 @@ bool Db::open(OpenMode mode, OpenError *error)
{
int action = (mode == DbUpd) ? Xapian::DB_CREATE_OR_OPEN :
Xapian::DB_CREATE_OR_OVERWRITE;
if (::access(dir.c_str(), 0) != 0) {
// New index. use a stub to force using Chert
if (!o_index_storedoctext && ::access(dir.c_str(), 0) != 0) {
// New index. use a stub to force using Chert. No
// sense in doing this if we are storing the text
// anyway.
string stub = path_cat(m_config->getConfDir(),
"xapian.stub");
FILE *fp = fopen(stub.c_str(), "w");
@@ -1463,7 +1465,7 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
LOGDEB("Db::addOrUpdate: split failed for main text\n");
} else {
#ifdef RAWTEXT_IN_VALUE
if (o_index_storerawtext) {
if (o_index_storedoctext) {
ZLibUtBuf buf;
deflateToBuf(doc.text.c_str(), doc.text.size(), buf);
string tt;
@@ -1683,7 +1685,7 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
}
#ifdef RAWTEXT_IN_DATA
if (o_index_storerawtext) {
if (o_index_storedoctext) {
RECORD_APPEND(record, string("RAWTEXT"),
neutchars(doc.text, cstr_nc));
}