Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 solr 响应的过滤查询 (fq) 中传递逗号分隔值,目前当我想传递多个类别时,我使用 OR 运算符。像这样 fq=categoryId:3 OR categoryId:55 OR categoryId:34
是否有任何解决方案可以传递诸如 fq=categoryId:3,55,34 之类的值
fq=categoryId:(3 55 34)如果您的默认运算符是 OR 应该可以工作。否则,请尝试fq=categoryId:(3 OR 55 OR 34)。这在 Lucene 查询语法中称为字段分组。(Solr 支持此处记录的完整 Lucene 语法。)
fq=categoryId:(3 55 34)
fq=categoryId:(3 OR 55 OR 34)
如果您的过滤查询字段是文本或字符串类型,您也可以使用 fq=categoryId:(IN 3 55 34 44) 。但 IN 运算符不适用于整数字段或其他字符串/文本字段。