【发布时间】:2014-02-24 20:29:11
【问题描述】:
我是 SOLR 的新手,我希望按标签对搜索结果进行排序。 在 SOLR 文档中存储标签的最佳做法是什么?字段类型设置的最佳做法是什么?
这是我当前将标签存储在逗号分隔列表中的方法。搜索的是“脚本”,但此设置似乎无法产生准确的结果:
[0] => Solarium\QueryType\Select\Result\Document Object
(
[fields:protected] => Array
(
[id] => 4912
[description] => Neuarmy™ » YYY_NEUARMY_YES02
[tags] => type,texture,script
[save_date] => 1345825890
[score] => 1.4771256
)
)
[1] => Solarium\QueryType\Select\Result\Document Object
(
[fields:protected] => Array
(
[id] => 1223
[description] => Timbas Type & Logo Dept.
[tags] => typography,logo,branding,script
[save_date] => 1342703206
[score] => 1.4771256
)
)
[2] => Solarium\QueryType\Select\Result\Document Object
(
[fields:protected] => Array
(
[id] => 1323
[description] => ibg1pE.jpg 300×200 pixels
[tags] => logo,script,interview magazine
[save_date] => 1352914647
[score] => 1.4771256
)
)
【问题讨论】:
-
您可以为标签创建一个多值字段。检查[stackoverflow.com/questions/5800762/…[1]:stackoverflow.com/questions/5800762/…