Skip to content

Commit

Permalink
Add comment and documentation for lucene regex filter annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-moessner committed Oct 7, 2024
1 parent 0b644b7 commit 2c24452
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions logprep/filter/lucene_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,15 @@ def __init__(self, tree: luqum.tree, special_fields: dict = None):
if not self._special_fields['regex_fields']:
self.recognize_regex_and_add_special_fields()
else:
# DEPRECATION: regex_fields are no longer necessary.
logger.warning("[Deprecation]: special_fields are no longer necessary. "
"Use Lucene regex annotation for filter ")

self._last_search_field = None

def recognize_regex_and_add_special_fields(self):
""" Recognize regex expressions in filter and add those fields to regex_fields.
"""
for child in self._tree.children:
value = child.children[0].value[1:-1]
if value.startswith('/') and value.endswith('/'):
Expand Down

0 comments on commit 2c24452

Please sign in to comment.