Compare commits

...

6 Commits

8 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,15 @@
# looqs: Release notes # looqs: Release notes
## 2022-10-22 - v0.8
CHANGES:
- For new, not previously indexed files, start creating an additional index using sqlite's experimental trigram tokenizer. Thanks to that, we can now match substrings >= 3 of an unicode sequence. Results of the usual index are prioritized.
- GUI: Ensure order of previews matches ranking exactly. Previously, it depended simply on the time preview generators took, i. e. it was more or less a race.
- Report progress more often during indexing, so users don't get the impression that it's stuck when processing dirs with large documents.
- Fix a regression that caused phrase queries to be broken
- Minor improvements
- Add packages: Ubuntu 22.10.
## 2022-09-10 - v0.7 ## 2022-09-10 - v0.7
CHANGES: CHANGES:

View File

@ -28,11 +28,12 @@ There is no need to write the long form of filters. There are also booleans avai
The screenshots in this section may occasionally be slightly outdated, but they are usually recent enough to get an overall impression of the current state of the GUI. The screenshots in this section may occasionally be slightly outdated, but they are usually recent enough to get an overall impression of the current state of the GUI.
## Current status ## Current status
Latest version: 2022-09-10, v0.7 Latest version: 2022-10-22, v0.8
Please keep in mind: looqs is still at an early stage and may exhibit some weirdness and contain bugs. Please keep in mind: looqs is still at an early stage and may exhibit some weirdness and contain bugs.
Please see [Changelog](CHANGELOG.md) for a human readable list of changes. Please see [Changelog](CHANGELOG.md) for a human readable list of changes. For download instructions, see
further down this document.
## Goals and principles ## Goals and principles
@ -96,7 +97,7 @@ The GUI is located in `gui/looqs-gui`, the binary for the CLI is in `cli/looqs`
## Packages ## Packages
At this point, looqs is not in any official distro package repo, but I maintain some packages. At this point, looqs is not in any official distro package repo, but I maintain some packages.
### Ubuntu 22.04 ### Ubuntu 22.04, 22.10
Latest release can be installed using apt from the repo. Latest release can be installed using apt from the repo.
``` ```
# First, obtain key, assume it's trusted. # First, obtain key, assume it's trusted.

View File

@ -44,9 +44,9 @@ class MainWindow : public QMainWindow
QHash<QString, int> previewOrder; /* Quick lookup for the order a preview should have */ QHash<QString, int> previewOrder; /* Quick lookup for the order a preview should have */
QMap<int, QWidget *> QMap<int, QWidget *>
previewWidgetOrderCache /* Saves those that arrived out of order to be inserted later at the correct pos */; previewWidgetOrderCache /* Saves those that arrived out of order to be inserted later at the correct pos */;
bool previewDirty; bool previewDirty = false;
int previewsPerPage; int previewsPerPage = 20;
unsigned int processedPdfPreviews; unsigned int processedPdfPreviews = 0;
unsigned int currentPreviewGeneration = 1; unsigned int currentPreviewGeneration = 1;
void connectSignals(); void connectSignals();

View File

@ -103,7 +103,7 @@ QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in,
int foundWordsCount = 0; int foundWordsCount = 0;
for(QString &word : config.wordsToHighlight) for(QString &word : config.wordsToHighlight)
{ {
QRegularExpression searchRegex("\\b" + word + "\\b"); QRegularExpression searchRegex("\\b" + QRegularExpression::escape(word) + "\\b");
bool containsRegex = line.contains(searchRegex); bool containsRegex = line.contains(searchRegex);
bool contains = false; bool contains = false;
if(!containsRegex) if(!containsRegex)

View File

@ -30,7 +30,7 @@ QByteArray PreviewResultPdf::serialize() const
QSharedPointer<PreviewResultPdf> PreviewResultPdf::deserialize(QByteArray &ba) QSharedPointer<PreviewResultPdf> PreviewResultPdf::deserialize(QByteArray &ba)
{ {
PreviewResultPdf *result = new PreviewResultPdf(); QSharedPointer<PreviewResultPdf> result(new PreviewResultPdf());
PreviewResultType type; PreviewResultType type;
QDataStream stream{&ba, QIODevice::ReadOnly}; QDataStream stream{&ba, QIODevice::ReadOnly};
@ -40,5 +40,5 @@ QSharedPointer<PreviewResultPdf> PreviewResultPdf::deserialize(QByteArray &ba)
throw std::runtime_error("Invalid byte array: Not a pdf preview"); throw std::runtime_error("Invalid byte array: Not a pdf preview");
} }
stream >> result->documentPath >> result->page >> result->previewImage; stream >> result->documentPath >> result->page >> result->previewImage;
return QSharedPointer<PreviewResultPdf>(result); return result;
} }

View File

@ -40,7 +40,8 @@ QByteArray PreviewResultPlainText::serialize() const
QSharedPointer<PreviewResultPlainText> PreviewResultPlainText::deserialize(QByteArray &ba) QSharedPointer<PreviewResultPlainText> PreviewResultPlainText::deserialize(QByteArray &ba)
{ {
PreviewResultPlainText *result = new PreviewResultPlainText(); QSharedPointer<PreviewResultPlainText> result(new PreviewResultPlainText());
PreviewResultType type; PreviewResultType type;
QDataStream stream{&ba, QIODevice::ReadOnly}; QDataStream stream{&ba, QIODevice::ReadOnly};
@ -50,5 +51,5 @@ QSharedPointer<PreviewResultPlainText> PreviewResultPlainText::deserialize(QByte
throw std::runtime_error("Invalid byte array: Not a pdf preview"); throw std::runtime_error("Invalid byte array: Not a pdf preview");
} }
stream >> result->documentPath >> result->page >> result->text; stream >> result->documentPath >> result->page >> result->text;
return QSharedPointer<PreviewResultPlainText>(result); return result;
} }

View File

@ -157,7 +157,6 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
throw LooqsGeneralException("Nothing to search for supplied"); throw LooqsGeneralException("Nothing to search for supplied");
} }
bool ftsAlreadyJoined = false;
auto tokens = query.getTokens(); auto tokens = query.getTokens();
for(const Token &token : tokens) for(const Token &token : tokens)
{ {

@ -1 +1 @@
Subproject commit e711a1d53a9210f8f562f774901e5e044d20e67a Subproject commit 769f729dc51f2feb8bc3cbb2a48ed91ff2d56bf3