Solr 对多个字段的搜索查询 [英] Solr search query over multiple fields

查看:48
本文介绍了Solr 对多个字段的搜索查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Solr 中使用两个不同的词在两个字段上进行搜索,并只返回包含这两个词的结果?

Is it possible to search in Solr over two fields using two different words and get back only those results which contain both of them?

例如,如果我有字段 "type" 和 "location" ,我只想要那些包含 type='furniture' 和 location = 'office' 的结果.

For example, if I have fields "type" and "location" , I want only those results who have type='furniture' and location = 'office' in them.

推荐答案

您可以使用布尔运算符并搜索单个字段.

You can use boolean operators and search on individual fields.

q=type:furniture AND location:office

如果值是固定的,最好使用过滤查询来提高性能.

If the values are fixed, it is better to use Filter Queries for Performance.

fq=type:furniture AND location:office

这篇关于Solr 对多个字段的搜索查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆