Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25a55d0

Browse files
authored
Merge pull request#202 from UncoderIO/gis-8556
Gis 8556 lucene fixes
2 parents372ea47 +594d3c5 commit25a55d0

File tree

1 file changed

+5
-2
lines changed
  • uncoder-core/app/translator/platforms/base/lucene

1 file changed

+5
-2
lines changed

‎uncoder-core/app/translator/platforms/base/lucene/tokenizer.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class LuceneTokenizer(QueryTokenizer, ANDLogicOperatorMixin):
3838
":>":OperatorType.GT,
3939
":<":OperatorType.LT,
4040
":":OperatorType.EQ,
41+
"==":OperatorType.EQ,
4142
}
4243
multi_value_operators_map:ClassVar[dict[str,str]]= {":":OperatorType.EQ}
4344

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

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

6667
escape_manager=lucene_escape_manager
6768

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

7879
@staticmethod
7980
defclean_multi_value(value:str)->str:
80-
returnvalue.strip('"')ifvalue.startswith('"')andvalue.endswith('"')elsevalue
81+
value=value.replace("\n","").replace(" ","")
82+
value=value.strip('"')ifvalue.startswith('"')andvalue.endswith('"')elsevalue
83+
returnvalue.strip()
8184

8285
defget_operator_and_value(# noqa: PLR0911
8386
self,match:re.Match,mapped_operator:str=OperatorType.EQ,operator:Optional[str]=None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp