Solr删除或清空索引
删除索引
1 | <delete><id>1</id></delete> |
或1
2<delete><query>id:1</query></delete>
<commit/>
清空索引
1 | <delete><query>*:*</query></delete> |
1 | <delete><id>1</id></delete> |
或1
2<delete><query>id:1</query></delete>
<commit/>
1 | <delete><query>*:*</query></delete> |
查询是时需要将score作为返回字段1
fl=*,score
Solr默认是按照score排序的,如果有下面需求,需要先按照某个字段排序(如类型),再按照score排序则需要传值1
sort=字段名 ASC,score DESC