return "[[:<:]]%s[[:>:]]" % word
-query_syntax_chars = re.compile(r"[\\/*:(){}?.]")
+query_syntax_chars = re.compile(r"[\\/*:(){}?.[\]+]")
def remove_query_syntax_chars(query, replace=' '):
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
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