0
我有一个关于solr查询的问题,它有两个多值字段。 Fllow它是架构的一部分:查询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 =属性:英语和语言环境:EN_US” 或“Q =属性:英文和区域设置:zh_CN“可以返回此文档。
我希望只有当条件是“q = attribute:english AND locale:en_US”或“q = attribute:chinese AND locale:zh_CN”才能返回文档,我该怎么办?
谢谢!
我不认为你可以用多值字段做到这一点。我想你需要分开你的问题的领域 –