2011-08-10 186 views
1

我想排序在我们的Solr索引中的年份字段(类型tint),我想确保遗漏字段排序在最后。我已经通过将sortMissingLast设置为true并重新启动服务器来在schema.xml中配置它,但似乎没有效果。当我按年分类时,空荡荡的岁月还处于起步阶段。sortMissingLast似乎没有工作

我是否需要完成重建索引才能使此更改生效?

感谢,

马尔科

下面是schema.xml中的相关线路。我们使用Solr的3.1

<fieldType name="tint" class="solr.TrieIntField" sortMissingLast="true" precisionStep="8" omitNorms="true" positionIncrementGap="0"/> 


<field name="year" type="tint" indexed="true" stored="true"/> 
+0

有没有Solr 4.1(还),你的意思是1.4? –

+0

你是对的,应该是Solr 3.1 – Marco

回答

1

Trie fields don't support sortMissingLast at the moment。改为使用可排序的字段。

根据最后的评论,这已经在Solr 4.0中修复了,所以或者你可能想要每晚做一次构建。

+0

这个问题的确与字段类型** solr.TrieIntField **有关。我现在已经使用了** solr.SortableIntField **,并重建了索引,并解决了这个问题。谢谢! – Marco