我有一个多值字段是" o_is_follow"它应该只返回单个值

时间:2016-04-12 06:29:46

标签: solr solrj solr4 solrcloud

C:\MAMP\htdocs\storybox1.0\public>php -r "print_r(get_loaded_extensions());"
Array
(
[0] => Core
[1] => bcmath
[2] => calendar
[3] => com_dotnet
[4] => ctype
[5] => date
[6] => ereg
[7] => filter
[8] => hash
[9] => iconv
[10] => json
[11] => mcrypt
[12] => SPL
[13] => odbc
[14] => pcre
[15] => Reflection
[16] => session
[17] => sockets
[18] => standard
[19] => mysqlnd
[20] => tidy
[21] => tokenizer
[22] => zip
[23] => zlib
[24] => libxml
[25] => dom
[26] => PDO
[27] => pdo_mysql
[28] => openssl
[29] => SimpleXML
[30] => soap
[31] => wddx
[32] => xml
[33] => xmlreader
[34] => xmlwriter
[35] => curl
[36] => mbstring
[37] => Phar
[38] => pdo_pgsql
[39] => pgsql

o / p: -

http://localhost:8983/solr/demo7/select?q=*:*&fq=o_photo_id:2014077070 AND o_is_follow:20120&indent=true&wt=xml

<arr name="o_is_follow">
 <str>{14317</str>
 <str>19863</str>
 <str>20120}</str>
</arr>

请帮帮我。

1 个答案:

答案 0 :(得分:0)

它不能。 MultiValued字段存储为单个项目,并一次性返回。

您应该考虑使用带有连接命令的子记录,或者可能突出显示以确定实际找到记录的哪个部分。

您也不需要在 fq 过滤器中使用 AND ,只需使用两个 fq 参数。