diff options
author | Jarek Kobus <jaroslaw.kobus@vacuumcleaner.com> | 2015-11-25 11:28:34 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2017-03-08 10:04:16 +0000 |
commit | d116ac573d80b6fdfdea4a56b7ae44f84e0ba6ad (patch) | |
tree | 829f2e9a994671064358073d6e8dcf1e2f74c8bd /src/assistant/help/qhelpenginecore.cpp | |
parent | 76ca291deee980e8952e438abb5a26e6468d0c29 (diff) |
Use sqlite's FTS5 for search
This change drops the usage of clucene library.
We store the plain text version of html content of
all the documentation inside the sqlite database.
We transform the html into plain text using
QTextDocumentFragment::fromHtml() and
QTextDocumentFragment::toPlainText() methods, what
causes the indexing a bit slower,
however it makes the indexing much more
accurate (try e.g. searching for
[charset] or ["utf-8"] keywords) and enables
showing the highlight (next patch).
Dropped usage of local socket in order to detect
if the other assistant instance is running.
Obsoleted the -rebuild-search-index cmd line option.
Comparison for the whole documentation of Qt:
Disk usage for index: ~15 MB (5.8), ~85 MB (current)
Indexing time: ~40 s (5.8), ~60 s (current).
Change-Id: I89f2fa9efddc354f86e5ed0f5b4f5e2790057121
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/assistant/help/qhelpenginecore.cpp')
-rw-r--r-- | src/assistant/help/qhelpenginecore.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp index 763ad43df..e6cbf5296 100644 --- a/src/assistant/help/qhelpenginecore.cpp +++ b/src/assistant/help/qhelpenginecore.cpp @@ -499,12 +499,15 @@ void QHelpEngineCore::setCurrentFilter(const QString &filterName) */ QList<QStringList> QHelpEngineCore::filterAttributeSets(const QString &namespaceName) const { + QList<QStringList> ret; if (d->setup()) { QHelpDBReader *reader = d->readerMap.value(namespaceName); if (reader) - return reader->filterAttributeSets(); + ret = reader->filterAttributeSets(); } - return QList<QStringList>(); + if (ret.isEmpty()) + ret.append(QStringList()); + return ret; } /*! |