Skip to content

Gis 8556 lucene fixes #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class LuceneTokenizer(QueryTokenizer, ANDLogicOperatorMixin):
":>": OperatorType.GT,
":<": OperatorType.LT,
":": OperatorType.EQ,
"==": OperatorType.EQ,
}
multi_value_operators_map: ClassVar[dict[str, str]] = {":": OperatorType.EQ}

Expand All @@ -61,7 +62,7 @@ class LuceneTokenizer(QueryTokenizer, ANDLogicOperatorMixin):

multi_value_pattern = rf"""\((?P<{ValueType.multi_value}>[:a-zA-Z\"\*0-9=+%#№;\-_\/\\'\,.$&^@!\(\[\]\s|]+)\)"""
multi_value_check_pattern = r"___field___\s*___operator___\s*\("
multi_value_delimiter_pattern = r"\s+OR\s+"
multi_value_delimiter_pattern = r"\s+(?:OR|or)\s+"

escape_manager = lucene_escape_manager

Expand All @@ -77,7 +78,9 @@ def create_field_value(field_name: str, operator: Identifier, value: Union[str,

@staticmethod
def clean_multi_value(value: str) -> str:
return value.strip('"') if value.startswith('"') and value.endswith('"') else value
value = value.replace("\n", "").replace(" ", "")
value = value.strip('"') if value.startswith('"') and value.endswith('"') else value
return value.strip()

def get_operator_and_value( # noqa: PLR0911
self, match: re.Match, mapped_operator: str = OperatorType.EQ, operator: Optional[str] = None
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy