2

我创建了 3 个属性popularityreviews_countpm_flat_volume

这 3 个属性包含数值 (int)。我在 Solr 中定义schema.xml了以下动态字段:

<dynamicField name="attr_sort_reviews_count_*" type="sint" indexed="true" stored="true"/>
<dynamicField name="attr_sort_pm_flat_volume_*" type="sint" indexed="true" stored="true"/>
<dynamicField name="attr_sort_popularity_*" type="sint" indexed="true" stored="true"/>

刷新“索引管理”中的字段后,会遇到以下结果:

  • reviews_count = 按 desc/asc 排序:正常工作
  • 受欢迎程度 = 按 desc/asc 排序:正常工作
  • pm_flat_volume = 按 desc/asc 排序:无法正常工作 (*)

(*) 如果我有 [1, 54, 2, 3, 91, 87, 100]

ASC = [1, 100, 2, 3, 54, 87, 91] it should be [1, 2, 3, 54, 87, 91, 100]
DESC = [91, 87, 54, 3, 2, 100, 1] it should be [100, 91, 87, 54, 3, 2, 1]

我尝试了不同的方法,但都没有奏效。我再说一遍,所有这 3 个属性都具有相同的配置。

谢谢!

4

1 回答 1

0

检查schema.xml 中条目的class属性以获取 the和fieldTypes。请确保他们正在使用. 我怀疑它使用的是字典顺序而不是数字顺序。<fieldType>sintintsolr.TrieIntFieldsolr.IntField

于 2013-01-17T13:30:58.370 回答