gpt4 book ai didi

java - 搜索 solr 关键字 "OR"、 "AND"AND “会报错[Hybris整合solr]

转载 作者:行者123 更新时间:2023-12-01 16:34:08 24 4
gpt4 key购买 nike

**搜索solr关键字“OR”、“AND”和“会报错。我本地环境不错,但是STG和DEV失败了,请问怎么解决。

可以通过在搜索条件前添加“\”来翻译搜索条件。还有其他解决方案吗?谢谢。

下面是错误日志:**

 ERROR [hCSHTTP10] [SolrSearchRequestResponsePopulator] Exception while executing SOLR search
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | de.hybris.platform.solrfacetsearch.search.FacetSearchException: Error from server at http://10.246.88.191:8983/solr: org.apache.solr.search.SyntaxError: Cannot parse '(skus_string_mv:(OR^40.0 OR *OR*^20.0)) OR (code_string:(OR^40.0 OR *OR*^20.0)) OR (styleNumber_string:(OR^40.0 OR *OR*^20.0)) OR (collectionName_text_en_mv:(or^160.0 OR *or*^80.0)) OR (collectionName_text_zh_mv:(or^160.0 OR *or*^80.0)) OR (keywords_text_en:(or^240.0 OR *or*^120.0)) OR (keywords_text_zh:(or^240.0 OR *or*^120.0)) OR (name_text_en:(or^220.0 OR *or*^110.0)) OR (name_text_zh:(or^220.0 OR *or*^110.0)) OR (categoryName_text_en_mv:(or^200.0)) OR (categoryName_text_zh_mv:(or^200.0)) OR (category_string_mv:(or^160.0 OR *or*^80.0)) OR (colorFamilyName_text_en:(or^140.0 OR *or*^70.0)) OR (colorFamilyName_text_zh:(or^140.0 OR *or*^70.0)) OR (swatchColorDisplayName_text_en:(or^140.0 OR *or*^70.0)) OR (swatchColorDisplayName_text_zh:(or^140.0 OR *or*^70.0)) OR (legacySkuCode_string:(OR^40.0 OR *OR*^20.0))': Encountered " <OR> "OR "" at line 1, column 17.
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | Was expecting one of:
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | <NOT> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | "+" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | "-" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | <BAREOPER> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | "(" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | "*" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | <QUOTED> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.453 | <TERM> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <PREFIXTERM> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <WILDTERM> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <REGEXPTERM> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | "[" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | "{" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <LPARAMS> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | "filter(" ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <NUMBER> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | <TERM> ...
INFO | jvm 1 | main | 2020/05/25 03:58:19.454 | "*" ...

最佳答案

使用这个\\AND

在我看来,这些是停用词,您不需要搜索它们,如果您想将它们用作逻辑运算符,那么只需这样做:q=java AND Python

关于java - 搜索 solr 关键字 "OR"、 "AND"AND “会报错[Hybris整合solr],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61995772/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com