Пример #1
0
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
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
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))
}