如何标记Solr中由“AND”运算符连接的两个过滤器?

时间:2013-09-04 12:51:05

标签: solr solrj solrnet

我正在使用Solr 4.0 我想标记由“AND”运算符连接的两个过滤器。

例如查询

(f_Memory:1+GB) AND (Manufacturer:ASUS)

我想像这样标记

{!tag=dm}(f_Memory:1+GB) AND {!tag=dt}(Manufacturer:ASUS)

但我收到错误

org.apache.lucene.queryparser.classic.ParseException: Cannot parse '(f_Memory:1+GB) AND {!tag=dt}(Manufacturer:ASUS)': Encountered " "}" "} "" at line 1, column 28.
Was expecting one of:
    "TO" ...
    <RANGE_QUOTED> ...
    <RANGE_GOOP> ..

知道该怎么做吗?

1 个答案:

答案 0 :(得分:3)

您可以尝试将它们分开,因为AND的效果会相同。

fq={!tag=dm}(f_Memory:1+GB)&fq={!tag=dt}(Manufacturer:ASUS)