示例#1
0
文件: search.go 项目: rlugojr/lucy
func NewDocIDSortRule(reverse bool) SortRule {
	cfObj := C.lucy_SortRule_new(C.lucy_SortRule_DOC_ID, nil, C.bool(reverse))
	return WRAPSortRule(unsafe.Pointer(cfObj))
}
示例#2
0
文件: search.go 项目: rlugojr/lucy
func NewScoreSortRule(reverse bool) SortRule {
	cfObj := C.lucy_SortRule_new(C.lucy_SortRule_SCORE, nil, C.bool(reverse))
	return WRAPSortRule(unsafe.Pointer(cfObj))
}
示例#3
0
文件: search.go 项目: rlugojr/lucy
func NewFieldSortRule(field string, reverse bool) SortRule {
	fieldC := clownfish.GoToClownfish(field, unsafe.Pointer(C.CFISH_STRING), false)
	cfObj := C.lucy_SortRule_new(C.lucy_SortRule_FIELD, (*C.cfish_String)(fieldC), C.bool(reverse))
	return WRAPSortRule(unsafe.Pointer(cfObj))
}