From ee405e3c09eaca074c958ffa2e5d312c23201e5c Mon Sep 17 00:00:00 2001 From: Kial Date: Mon, 25 Mar 2024 15:00:15 -0400 Subject: [PATCH] 18717 small bug fix (#259) * keep periods in value query Signed-off-by: Kial Jinnah * version update Signed-off-by: Kial Jinnah --------- Signed-off-by: Kial Jinnah --- search-api/src/search_api/request_handlers/search.py | 12 ------------ search-api/src/search_api/services/solr/solr.py | 2 +- search-api/src/search_api/version.py | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/search-api/src/search_api/request_handlers/search.py b/search-api/src/search_api/request_handlers/search.py index de484b4b..fe8ef903 100644 --- a/search-api/src/search_api/request_handlers/search.py +++ b/search-api/src/search_api/request_handlers/search.py @@ -51,18 +51,6 @@ def business_search(params: SearchParams): ], [SolrField.NAME_Q.value] ) - # TODO: add nested parties query - # NB: keeping for future: build a query based on child values and return parent doc - # child_query = Solr.build_child_query(query, - # SolrField.PARTIES, - # [SolrField.PARTY_NAME_Q,SolrField.PARTY_NAME_STEM_AGRO], - # SolrField.PARTY_NAME_SINGLE) - # terms = query.split() - # child_filter = f'"{SolrField.PARTY_NAME_SINGLE}:{terms[0]}' - # for term in terms[1:]: - # child_filter += f' AND {SolrField.PARTY_NAME_SINGLE}:{term}' - # child_filter += '"' - # child_query += solr.nest_fields_party.format(filter=child_filter) # facets solr_query_params['facet'] = 'on' diff --git a/search-api/src/search_api/services/solr/solr.py b/search-api/src/search_api/services/solr/solr.py index de0441e3..4c294a06 100644 --- a/search-api/src/search_api/services/solr/solr.py +++ b/search-api/src/search_api/services/solr/solr.py @@ -298,7 +298,7 @@ def parse_facets(facet_data: Dict) -> Dict: def prep_query_str(query: str) -> str: """Return query string prepped for solr call.""" # replace solr specific special chars - rmv_spec_chars_rgx = r'([\[\]!()\"~*?:/\\={}^%`#|<>,.@$;_\-])' + rmv_spec_chars_rgx = r'([\[\]!()\"~*?:/\\={}^%`#|<>,@$;_\-])' handled_spec_chars_rgx = r'([&+]+)' query = re.sub(rmv_spec_chars_rgx, ' ', query.lower()) return re.sub(handled_spec_chars_rgx, r' \\\1 ', query) if not query.isspace() else r'\*' diff --git a/search-api/src/search_api/version.py b/search-api/src/search_api/version.py index ac386876..e555aacb 100644 --- a/search-api/src/search_api/version.py +++ b/search-api/src/search_api/version.py @@ -22,4 +22,4 @@ Development release segment: .devN """ -__version__ = '1.0.9.post1' # pylint: disable=invalid-name +__version__ = '1.0.10' # pylint: disable=invalid-name