在Solr的索引的记录,可以说,我有这个样本记录(例如JSON):SOLR查询自定义排序筛选结果?
{
"title":"Innovation Life and Strategy",
"author":"Sarah Howard",
},
{
"title":"Simple Life", <--- This will be ignored
"author":"W. David",
},
{
"title":"Today's Innovations",
"author":"Michael Wayne", <--- This Author will be listed at the top
},
{
"title":"The Innovation Records",
"author":"Tommy Wright",
},
etc ..
如何让Solr的查询到:
- 通过
innovation
在title
领域
过滤(所以我们有3条记录) - 然后,排序结果通过将作者:
Wayne
在顶部
所以最终的结果应该是:
{
"title":"Today's Innovations",
"author":"Michael Wayne",
},
{
"title":"Innovation Life and Strategy",
"author":"Sarah Howard",
},
{
"title":"The Innovation Records",
"author":"Tommy Chen",
},
我只得到了第一个步骤,fq=title:*Innovation*
但我不知道第二步(自定义排序)查询。
我怎样才能得到它?
什么是自定义排序的基础或逻辑或规则?有没有任何固定的逻辑? – Jayendra 2012-08-10 09:00:56
我不知道。你知道吗? – 2012-08-10 09:07:58
我的意思是你的自定义排序背后的逻辑是什么?因为在这种情况下,重点看起来很方便,但在其他方面会有所不同。你可以提高你的结果,这将导致它总是出现。但是,如果没有任何规则集,这将是没有意义的,也不是通用的。 – Jayendra 2012-08-10 09:37:06