为来自 Solr 的 Facet 设置自定义顺序 [英] Set Custom Order for Facets coming from Solr

查看:28
本文介绍了为来自 Solr 的 Facet 设置自定义顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Solr 为电子商务网站提供分面导航.但是我需要为构面定义自定义顺序,但我没有在 Solr 中找到如何做到这一点.

I'm using Solr for offering faceted navigation for e-commerce site. However I need to define the custom order for facets, but I didn't find how to do that in Solr.

知道怎么做吗?我正在使用 Solr Net 和最新版本的 Solr.

Any idea how to do this? I'm using Solr Net and latest version of Solr.

这是我需要做的一个例子.

Here is an example what I need to do.

当前的方面

操作系统

  • 安卓 (32)
  • 黑莓操作系统 (8)
  • Windows (6)
  • 苹果 iOS (6)
  • 八达 (5)
  • 专有 (2)

价格

  • 10001 - 20000 (42)
  • 20001 - 25000 (12)
  • 500 - 5000 (11)
  • 5001 - 10000 (8)

请注意,这只是一个示例.并有许多其他方面.我想将价格显示为第一个方面,因此需要对这个方面字段以及这样的方面选项进行排序.

Note that it is just an example. And have many other facets. I want to display Price as the first facet, so need to order this facet field as well as facet options like this.

价格

  • 500 - 5000 (11)
  • 5001 - 10000 (8)
  • 10001 - 20000 (42)
  • 20001 - 25000 (12)

操作系统

  • 安卓 (32)
  • 苹果 iOS (6)
  • 八达 (5)
  • 黑莓操作系统 (8)
  • 专有 (2)
  • Windows (6)

所以这是我需要的订购方式:

So here is how I need to order it:

  1. 通过某种方式手动订购 Facet 字段,以便它们按特定顺序显示
  2. 按照定义的顺序对方面进行排序.对于操作系统,我按字母顺序排列.或者可能对于那些没有定义顺序的方面可以根据结果中的计数数量作为默认顺序?

请多多指教.

推荐答案

您可以对每个字段使用分面排序来分别对不同的分面进行排序.

You can use facet sort per field to order the different facets respectively.

例如f..facet.sort=count|index

Solr 只提供了 Count 和 Index sort 两个选项.其他任何事情都需要通过自定义解决方案或变通办法来实现.

Solr only provided two options Count and Index sort. Anything else needs to implemented through custom solutions or workarounds.

这篇关于为来自 Solr 的 Facet 设置自定义顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆