diff --git a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp index d9abfcaf..7ab46f30 100644 --- a/src/rcldb/searchdata.cpp +++ b/src/rcldb/searchdata.cpp @@ -106,6 +106,13 @@ bool SearchData::expandFileTypes(const RclConfig *cfg, vector& tps) return true; } +static const char *maxXapClauseMsg = + "Maximum Xapian query size exceeded. Increase maxXapianClauses " + "in the configuration. "; +static const char *maxXapClauseCaseDiacMsg = + "Or try to use case (C) or diacritics (D) sensitivity qualifiers." + ; + bool SearchData::clausesToQuery(Rcl::Db &db, SClType tp, vector& query, string& reason, void *d) @@ -145,13 +152,16 @@ bool SearchData::clausesToQuery(Rcl::Db &db, SClType tp, xq = Xapian::Query(op, xq, nq); } if (int(xq.get_length()) >= getMaxCl()) { - LOGERR(("Maximum Xapian query size exceeded." - " Maybe increase maxXapianClauses.")); - m_reason += "Maximum Xapian query size exceeded." - " Maybe increase maxXapianClauses."; + LOGERR(("%s\n", maxXapClauseMsg)); + m_reason += maxXapClauseMsg; + if (!o_index_stripchars) + m_reason += maxXapClauseCaseDiacMsg; return false; } } + + LOGDEB0(("SearchData::clausesToQuery: got %d clauses\n", xq.get_length())); + if (xq.empty()) xq = Xapian::Query::MatchAll; @@ -164,6 +174,9 @@ bool SearchData::toNativeQuery(Rcl::Db &db, void *d) LOGDEB(("SearchData::toNativeQuery: stemlang [%s]\n", m_stemlang.c_str())); m_reason.erase(); + db.getConf()->getConfParam("maxTermExpand", &m_maxexp); + db.getConf()->getConfParam("maxXapianClauses", &m_maxcl); + // Walk the clause list translating each in turn and building the // Xapian query tree Xapian::Query xq; @@ -624,7 +637,7 @@ bool SearchDataClauseSimple::expandTerm(Rcl::Db &db, // Term match entries to vector of terms if (int(res.entries.size()) >= maxexpand && !maxexpissoft) { ermsg = "Maximum term expansion size exceeded." - " Maybe increase maxTermExpand."; + " Maybe use case/diacritics sensitivity or increase maxTermExpand."; return false; } for (vector::const_iterator it = res.entries.begin(); @@ -956,8 +969,9 @@ bool SearchDataClauseSimple::processUserString(Rcl::Db &db, const string &iq, useNear, slack); } if (m_curcl >= getMaxCl()) { - ermsg = "Maximum Xapian query size exceeded." - " Maybe increase maxXapianClauses."; + ermsg = maxXapClauseMsg; + if (!o_index_stripchars) + ermsg += maxXapClauseCaseDiacMsg; break; } } diff --git a/src/sampleconf/recoll.conf.in b/src/sampleconf/recoll.conf.in index 965cacb0..7bf43552 100644 --- a/src/sampleconf/recoll.conf.in +++ b/src/sampleconf/recoll.conf.in @@ -114,8 +114,8 @@ maxTermExpand = 10000 # Maximum number of clauses we add to a single Xapian query. In some cases, # the result of term expansion can be multiplicative, and we want to avoid -# eating all the memory. Default 100 000 -maxXapianClauses = 100000 +# eating all the memory. Default 50000 +maxXapianClauses = 50000 # Where to store the database (directory). This may be an absolute path, # else it is taken as relative to the configuration directory (-c argument