X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/cad95a5f21346628d1dffa3b50ffa8f38baa5972..5aa13410812d3fc4b35c039bdc3f0a2edc5185a1:/src/search/views.py diff --git a/src/search/views.py b/src/search/views.py index 6cb6bc53e..39284c70c 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -27,7 +27,7 @@ def match_word_re(word): return "[[:<:]]%s[[:>:]]" % word -query_syntax_chars = re.compile(r"[\\/*:(){}]") +query_syntax_chars = re.compile(r"[\\/*:(){}?.[\]+]") def remove_query_syntax_chars(query, replace=' '): @@ -151,10 +151,10 @@ def search_books(query): search_fields = [] words = query.split() fieldsets = ( - (['authors'], True), - (['title'], True), - (['metadata'], True), - (['text', 'themes_pl'], False), + (['authors', 'authors_nonstem'], True), + (['title', 'title_nonstem'], True), + (['metadata', 'metadata_nonstem'], True), + (['text', 'text_nonstem', 'themes_pl', 'themes_pl_nonstem'], False), ) for fields, is_book in fieldsets: search_fields += fields @@ -191,10 +191,10 @@ def search_pictures(query): search_fields = [] words = query.split() fieldsets = ( - (['authors'], True), - (['title'], True), - (['metadata'], True), - (['themes_pl'], False), + (['authors', 'authors_nonstem'], True), + (['title', 'title_nonstem'], True), + (['metadata', 'metadata_nonstem'], True), + (['themes_pl', 'themes_pl_nonstem'], False), ) for fields, is_book in fieldsets: search_fields += fields