在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