Documentation
¶
Index ¶
- type Index
- func (i *Index) AddTerms(terms ...index.Suggestion) error
- func (i *Index) Create() error
- func (i *Index) Delete() error
- func (i *Index) Drop() error
- func (i *Index) FullTextQuerySingleField(q query.Query, verbose int) (docs []index.Document, total int, err error)
- func (i *Index) GetName() string
- func (i *Index) Index(documents []index.Document, options interface{}) error
- func (i *Index) PrefixQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)
- func (i *Index) Suggest(prefix string, num int, fuzzy bool) ([]index.Suggestion, error)
- func (i *Index) WildCardQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)
- type SuggestResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index represents an index in Solr
func NewIndex ¶
NewIndex creates a new solr index for the given solr url and index name. Metadata is ignored, we are using an automatic solr schema
func (*Index) AddTerms ¶
func (i *Index) AddTerms(terms ...index.Suggestion) error
AddTerms doesn't do anything and is here for interface compliance reasons.
Not implemented since we do this automatically in the indexing itself
func (*Index) FullTextQuerySingleField ¶
func (i *Index) FullTextQuerySingleField(q query.Query, verbose int) (docs []index.Document, total int, err error)
Search searches the index for the given query, and returns documents, the total number of results, or an error if something went wrong
func (*Index) Index ¶
Index indexes multiple documents on the index, with optional IndexingOptions passed to options
func (*Index) PrefixQuery ¶
func (i *Index) PrefixQuery(q query.Query, verbose int) (docs []index.Document, total int, err error)
Search searches the index for the given query, and returns documents, the total number of results, or an error if something went wrong
type SuggestResponse ¶
type SuggestResponse struct {
ResponseHeader struct {
Status int `json:"status"`
QTime int `json:"QTime"`
} `json:"responseHeader"`
Suggest struct {
Autocomplete map[string]struct {
NumFound int `json:"numFound"`
Suggestions []struct {
Term string `json:"term"`
Weight float64 `json:"weight"`
Payload string `json:"payload"`
} `json:"suggestions"`
} `json:"autocomplete"`
} `json:"suggest"`
}
SuggestResponse parses the suggest responses because the solr client doesn't include this feature