Documentation ¶
Index ¶
- func BuildFilters(req SearchRequest) []elastic.Query
- func Connect() (err error)
- func CreateSnapshot(indices ...string) (string, error)
- func GetESDocument(doi string) (map[string]interface{}, error)
- func GetSnapshotStatus(name string) (string, error)
- func LoadSnapshot(addr string, snapshotName string) error
- func NewProcessTerms(req SearchRequest) elastic.Query
- type IndexMetadata
- type SearchRequest
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFilters ¶
func BuildFilters(req SearchRequest) []elastic.Query
func CreateSnapshot ¶
func GetESDocument ¶
func GetSnapshotStatus ¶
func LoadSnapshot ¶
func NewProcessTerms ¶
func NewProcessTerms(req SearchRequest) elastic.Query
Types ¶
type IndexMetadata ¶
type IndexMetadata struct { Name string `json:"name"` Size float32 `json:"indexSize"` SizeContent float32 `json:"contentSize"` }
func GetIndexMetadata ¶
func GetIndexMetadata() ([]*IndexMetadata, error)
type SearchRequest ¶
type SearchRequest struct { Query string `json:"query"` Filters []string `json:"filters"` Offset int `json:"offset"` Limit int `json:"limit"` Facets []string `json:"facets"` Stats []string `json:"stats"` Fields []string `json:"fields"` Highlight []string `json:"highlight"` }
SearchRequest represents an incoming search from the app
type SearchResult ¶
type SearchResult struct { Total int64 `json:"total"` QueryTime int64 `json:"qtime"` Documents []map[string]interface{} `json:"docs"` Stats map[string]interface{} `json:"stats"` Facets map[string][]map[string]interface{} `json:"facets"` }
SearchResult represents an outgoing result to the app
func ParseResults ¶
func ParseResults(esRes *elastic.SearchResult) *SearchResult
Click to show internal directories.
Click to hide internal directories.