我的多值字段没有匹配到
我的架构中有几个多值字段,但是当我搜索应从这些字段生成结果的术语时,没有返回任何结果。
例如,在我的架构中,有一个像这样的多值字段:
<field name="tag" type="text_general" indexed="true" stored="true" multiValued="true"/>
当我使用这样的查询对标签进行搜索时...
{!dismax q.op=AND}test
我在单值字段中得到带有“test”的结果,但在多值字段。我转储搜索返回的结果以验证存储的内容。
(matches when I search "test")
name: TEST 4
description: i match the query "test"
year: 2010
id: 61
(does not match when I search "test")
name: BEST 4
description: i do not match the query
year: 2010
id: 68
tags: (array)
0:test
1:test2
2:i'm a test
我无法通过搜索找到类似的问题,所以我觉得我一定错过了一些东西。有人能指出我正确的方向吗?
I have a couple of multi-valued fields in my schema, but when I search on terms that should produce results from these fields, no results come back.
For example, in my schema there is a multi-valued field like this:
<field name="tag" type="text_general" indexed="true" stored="true" multiValued="true"/>
When I do a search on a tag with a query like this ...
{!dismax q.op=AND}test
I get results with "test" in the single-valued fields, but not in the multi-valued fields. I dump the results I get back from searching to verify what is stored.
(matches when I search "test")
name: TEST 4
description: i match the query "test"
year: 2010
id: 61
(does not match when I search "test")
name: BEST 4
description: i do not match the query
year: 2010
id: 68
tags: (array)
0:test
1:test2
2:i'm a test
I wasn't able to find similar problems with a search so I feel like I must have missed something. Can anyone point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标签是否包含在可搜索字段列表中?
您正在搜索哪些领域?您可能想添加标签。
当您使用 defType 作为 dismax 时,您可以尝试在 url 中传递 qf=tags 来测试名称为 BEST 4 的文档是否随结果一起返回。
用于搜索名称、描述和标签的示例 solrconfig.xml 条目 -
使用 url 作为
Are the tags included into the list of searchable fields ?
What are the fields you are searching on ? you might want to add tags.
As you are using defType as dismax, you can try passing qf=tags in url to test if the the document with name BEST 4 is returned with the results.
Example solrconfig.xml entry for searching on name, description and tags -
use url as