Solr中在使用过程中遇到的"与"和"或"的问题

在进行全文检索的过程中,如果使用三星和手机,两个一块进行搜索的时候,关于三星的会被搜索出来,关于手机的信息也会被搜索出来,然后,需要将一些配置文件进行配置,

 <!-- DEPRECATED: The defaultOperator (AND|OR) is consulted by various query parsers
  when parsing a query string to determine if a clause of the query should be marked as
  required or optional, assuming the clause isn't already marked by some operator.
  The default is OR, which is generally assumed so it is not a good idea to change it
  globally here.  The "q.op" request parameter takes precedence over this.
 <solrQueryParser defaultOperator="OR"/> -->
<solrQueryParser defaultOperator="AND"/>

将描红的地方需要进行修改为AND,然后重新启动服务器.

猜你喜欢

转载自www.cnblogs.com/qingmuchuanqi48/p/10753255.html