mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
727 B
28 lines
727 B
3 years ago
|
package core
|
||
|
|
||
|
import (
|
||
|
"github.com/rocboss/paopao-ce/pkg/zinc"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
SearchTypeDefault SearchType = "search"
|
||
|
SearchTypeTag SearchType = "tag"
|
||
|
)
|
||
|
|
||
|
type SearchType string
|
||
|
|
||
|
type QueryT struct {
|
||
|
Query string
|
||
|
Type SearchType
|
||
|
}
|
||
|
|
||
|
// SearchService search service interface that implement base zinc
|
||
|
type SearchService interface {
|
||
|
CreateSearchIndex(indexName string)
|
||
|
BulkPushDoc(data []map[string]interface{}) (bool, error)
|
||
|
DelDoc(indexName, id string) error
|
||
|
QueryAll(q *QueryT, indexName string, offset, limit int) (*zinc.QueryResultT, error)
|
||
|
QuerySearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error)
|
||
|
QueryTagSearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error)
|
||
|
}
|