我有一组标签多次出现的 xml 文档。例如<Address>
以下文档中的标签。换句话说,父标签地址出现了 2 次。
我想搜索Name=ABCD
并ZipCode=33333
希望 solr 返回类似于下面给出的“响应文档”的响应。是否可以在 solr4.0 中执行此操作而不将 Address 定义为一个多值单字段,所有子字段都由分隔符分隔?
文档
<doc>
<Name>ABCD</Name>
<CompanyName>1234</CompanyName>
<Address>
<AddressLine1> 1725 ABCD Drive </AddressLine1>
<AddressLine2> </Address Line2>
<City>Miami</City>
<State>FL</State>
<Zipcode>33333</Zipcode>
<AddressType>Home</AddressType>
</Address>
<Address>
<AddressLine1> 16551 business blvd </AddressLine1>
<AddressLine2> </Address Line2>
<City>Miami</City>
<State>FL</State>
<Zipcode>33333</Zipcode>
<AddressType>Business</AddressType>
</Address>
</doc>
<doc>
<Name>XYZWR</Name>
<CompanyName>1234</CompanyName>
<Address>
<AddressLine1> 1725 ABCD Drive </AddressLine1>
<AddressLine2> </Address Line2>
<City>Miami</City>
<State>FL</State>
<Zipcode>33333</Zipcode>
<AddressType>Home</AddressType>
</Address>
<Address>
<AddressLine1> 16551 business blvd </AddressLine1>
<AddressLine2> </Address Line2>
<City>Phoenix</City>
<State>AZ</State>
<Zipcode>33333</Zipcode>
<AddressType>Business</AddressType>
</Address>
</doc>
响应文件
<doc>
<Name>ABCD</Name>
<CompanyName>1234</CompanyName>
<Address>
<AddressLine1> 1725 ABCD Drive </AddressLine1>
<AddressLine2> </Address Line2>
<City>Miami</City>
<State>FL</State>
<Zipcode>33333</Zipcode>
<AddressType>Home</AddressType>
</Address>
<Address>
<AddressLine1> 16551 business blvd </AddressLine1>
<AddressLine2> </Address Line2>
<City>Miami</City>
<State>FL</State>
<Zipcode>33333</Zipcode>
<AddressType>Business</AddressType>
</Address>
</doc>
问候