make sure that expansions of * done to retrieve all years or all mime types from index are done against the appropriate field section of the main index, not the whole synexpand one

This commit is contained in:
Jean-Francois Dockes
2013-04-13 16:34:09 +02:00
parent 324f878583
commit aaa98a1156
7 changed files with 37 additions and 22 deletions
+3
View File
@@ -293,6 +293,9 @@ void AdvSearch::fillFileTypes()
QStringList ql;
if (m_ignByCats == false) {
vector<string> types = theconfig->getAllMimeTypes();
rcldb->getAllDbMimeTypes(types);
sort(types.begin(), types.end());
types.erase(unique(types.begin(), types.end()), types.end());
for (vector<string>::iterator it = types.begin();
it != types.end(); it++) {
QString qs = QString::fromUtf8(it->c_str());
+4 -11
View File
@@ -1108,24 +1108,17 @@ void RclMain::showActiveTypes()
return;
}
// Get list of all mime types in index. For this, we use a
// wildcard field search on mtype
Rcl::TermMatchResult matches;
if (!rcldb->termMatch(Rcl::Db::ET_WILD, "", "*", matches, -1, "mtype")) {
// All mime types in index.
vector<string> vdbtypes;
if (!rcldb->getAllDbMimeTypes(vdbtypes)) {
QMessageBox::warning(0, tr("Error"),
tr("Index query error"),
QMessageBox::Ok,
QMessageBox::NoButton);
return;
}
// Build the set of mtypes, stripping the prefix
set<string> mtypesfromdb;
for (vector<Rcl::TermMatchEntry>::const_iterator it =
matches.entries.begin();
it != matches.entries.end(); it++) {
mtypesfromdb.insert(it->term.substr(matches.prefix.size()));
}
mtypesfromdb.insert(vdbtypes.begin(), vdbtypes.end());
// All types listed in mimeconf:
vector<string> mtypesfromconfig = theconfig->getAllMimeTypes();
+3 -6
View File
@@ -352,16 +352,13 @@ int SSearch::partialWord(string& s)
}
// Create completion list for term by adding a joker at the end and calling
// rcldb->termMatch(). This does not work well if the db is not
// rcldb->stripped, the completion is casediac-sensitive in this case.
//
// What we should do instead is complete the term from the key list in
// the casediac expansion db (stripped->unstripped synonyms table),
// then expand each of the completed keys.
// rcldb->termMatch().
int SSearch::completionList(string s, QStringList& lst, int max)
{
if (!rcldb)
return -1;
if (s.empty())
return 0;
// Query database for completions
s += "*";
Rcl::TermMatchResult tmres;
+4 -1
View File
@@ -22,7 +22,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -284,6 +284,9 @@
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>8</number>
</property>