mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-22 21:53:03 +03:00
Increased type and search result limits from 500 and 40 to 1000 and 100
This commit is contained in:
parent
1bc00d09fe
commit
e1cb0a6985
@ -64,12 +64,12 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum)
|
||||
QSqlQuery q;
|
||||
QList<QList<QVariant> > found;
|
||||
bool withSubStrings = false;
|
||||
while(found.size() < 40) {
|
||||
while(found.size() < 100) {
|
||||
auto curQuery = query;
|
||||
QString notQuery; // don't return the same result twice
|
||||
QString parentQuery;
|
||||
if(withSubStrings) {
|
||||
// if less than 40 found starting with query, search all substrings
|
||||
// if less than 100 found starting with query, search all substrings
|
||||
curQuery = "%"+query;
|
||||
if(types[name] == ZDASH) {
|
||||
notQuery = QString(" and not (ztokenname like '%1%' escape '\\' or ztokenname like '%.%1%' escape '\\') ").arg(query);
|
||||
@ -83,11 +83,11 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum)
|
||||
int cols = 3;
|
||||
if(types[name] == ZEAL) {
|
||||
qstr = QString("select t.name, t2.name, t.path from things t left join things t2 on t2.id=t.parent where "
|
||||
"(t.name like '%1%' escape '\\' %3) %2 order by lower(t.name) asc, t.path asc limit 40").arg(curQuery, notQuery, parentQuery);
|
||||
"(t.name like '%1%' escape '\\' %3) %2 order by lower(t.name) asc, t.path asc limit 100").arg(curQuery, notQuery, parentQuery);
|
||||
|
||||
} else if(types[name] == DASH) {
|
||||
qstr = QString("select t.name, null, t.path from searchIndex t where t.name "
|
||||
"like '%1%' escape '\\' %2 order by lower(t.name) asc, t.path asc limit 40").arg(curQuery, notQuery);
|
||||
"like '%1%' escape '\\' %2 order by lower(t.name) asc, t.path asc limit 100").arg(curQuery, notQuery);
|
||||
} else if(types[name] == ZDASH) {
|
||||
cols = 4;
|
||||
qstr = QString("select ztokenname, null, zpath, zanchor from ztoken "
|
||||
@ -96,7 +96,7 @@ void ZealDocsetsRegistry::_runQuery(const QString& query_, int queryNum)
|
||||
// %.%1% for long Django docset values like django.utils.http
|
||||
// (Might be not appropriate for other docsets, but I don't have any on hand to test)
|
||||
"like '%1%' escape '\\' or ztokenname like '%.%1%' escape '\\' ) %2 order by lower(ztokenname) asc, zpath asc, "
|
||||
"zanchor asc limit 40").arg(curQuery, notQuery);
|
||||
"zanchor asc limit 100").arg(curQuery, notQuery);
|
||||
}
|
||||
q = db(name).exec(qstr);
|
||||
while(q.next()) {
|
||||
|
@ -39,7 +39,7 @@ const QHash<QPair<QString, QString>, int> ZealListModel::getModulesCounts() cons
|
||||
q = db.exec("select ztokentype, count(*) from ztoken group by ztokentype");
|
||||
}
|
||||
while(q.next()) {
|
||||
if(q.value(1).toInt() < 500) {
|
||||
if(q.value(1).toInt() < 1500) {
|
||||
QString typeName;
|
||||
if(docsets->type(name) == ZEAL || docsets->type(name) == DASH) {
|
||||
typeName = q.value(0).toString();
|
||||
|
Loading…
Reference in New Issue
Block a user