eikek / eikek/docspell

Using the "%" (percent) wildcard with the like operator in name queries

Open
#1,114 5 comments 0 reactions 0 assignees View on GitHub
bug restserver
Dominant language
Elm
Stars
2.3k
Forks
184
Avg merge
8h 2m
Merged PRs (30d)
4

Description

Hi,
I've just started using docspell, and noticed that the "%" can be used as wildcard instead of the "*" asterisk.
I think that's because the percent sign is used as wildcard in SQL LIKE queries (e.g. [mariadb](https://mariadb.com/kb/en/like/), [postgres](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE) ) and isn't escaped by docspell.
The "%" is more powerful than the asterisk, as it also can be used in between ("t%t" matches "test").

The "_" (underscore), which can be used to match any single character, also works.

(Tested only on PostgreSQL for the name and source fields).

I think both are more a feature than a bug and should be documented.
And the asterisk, as it can be replaced by "%", should be removed (or deprecated)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.