mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
FIX BUG: case-sensitive matching was not possible
This commit is contained in:
parent
ce5fe61e67
commit
7106c68032
1 changed files with 3 additions and 2 deletions
|
|
@ -60,14 +60,15 @@ def match_tags(document, classifier):
|
||||||
def matches(matching_model, document):
|
def matches(matching_model, document):
|
||||||
search_kwargs = {}
|
search_kwargs = {}
|
||||||
|
|
||||||
document_content = document.content.lower()
|
|
||||||
|
|
||||||
# Check that match is not empty
|
# Check that match is not empty
|
||||||
if matching_model.match.strip() == "":
|
if matching_model.match.strip() == "":
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if matching_model.is_insensitive:
|
if matching_model.is_insensitive:
|
||||||
search_kwargs = {"flags": re.IGNORECASE}
|
search_kwargs = {"flags": re.IGNORECASE}
|
||||||
|
document_content = document.content.lower()
|
||||||
|
else:
|
||||||
|
document_content = document.content
|
||||||
|
|
||||||
if matching_model.matching_algorithm == MatchingModel.MATCH_ALL:
|
if matching_model.matching_algorithm == MatchingModel.MATCH_ALL:
|
||||||
for word in _split_match(matching_model):
|
for word in _split_match(matching_model):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue