【发布时间】:2012-09-12 05:57:46
【问题描述】:
我有一个关于 solr 查询的问题,它有两个多值字段。 流它是架构的一部分:
<field name="attribute" type="text" indexed="true" stored="true" multiValued="true"/>
<field name="locale" type="text" indexed="true" stored="true" multiValued="true"/>
它从 xml 中读取数据:
<docs>
<doc>
<id>01000</id>
<name>product1</name>
<price>102.5</price>
<attributes name="description">
<str attribute="this is english description" locale="en_US" />
<str attribute="this is chinese description" locale="zh_CN" />
</attributes>
</doc>
</docs>
问题是查询条件“q=attribute:english AND locale:en_US”或“q=attribute:english AND locale:zh_CN”可以返回此文档。
我希望只有当条件是“q=attribute:english AND locale:en_US”或“q=attribute:chinese AND locale:zh_CN”时才能返回文档,我该怎么做?
谢谢!
【问题讨论】:
-
我不认为你可以用多值字段做到这一点。我想你需要为你的问题分开字段