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:
@@ -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
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user