Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DisMax is a valid defType to specify the dismax query parser. DisMax = "dismax" // ExtendedDisMax is a valid defType to specify the extended dismax query parser. ExtendedDisMax = "edismax" )
Variables ¶
Functions ¶
func Index ¶
Index will send a batch of documents to Solr for upsertion.
func Init ¶
Init will initialize the Solr client. If an error is returned, Solr isn't available or configured properly.
Types ¶
type Options ¶
Options are configuration settings for Solr.
type Query ¶ added in v1.0.2
type Query struct { Q string Op string /* q.op: AND or OR (default: AND) */ DefType string /* defType: dismax or lucense */ Qf string /* query fields for dismax */ Bf string /* boost function to influence matches */ Bq string /* boost query allows you to boost certain queries */ Fq []string /* filter queries will filter out by a field */ Boost string /* boost field list parameter */ Mm string /* minimum match */ Filter string /* filter the fields returned by Solr */ Sort string /* sort the documents returned by Solr */ Start int /* which document to start from */ Rows int /* the number of documents per-page */ }
Query represents a search query.
type Response ¶ added in v1.0.2
type Response struct { ResponseHeader struct { Status int `json:"status"` QTime int `json:"QTime"` Params struct { Q string `json:"q"` QOp string `json:"q.op"` WT string `json:"wt"` } `json:"params"` } `json:"responseHeader"` Response struct { NumFound int `json:"numFound"` Start int `json:"start"` Docs []struct { UUID string `json:"uuid"` } `json:"docs"` } `json:"response"` Status string `json:"status"` }
Response is the raw Solr search response. The format matches the JSON response format for Solr. This is a bit clunky to work with.
type Result ¶ added in v1.0.2
type Result struct { Response NumFound int /* total documents found for the query */ Query *Query /* metadata regarding the query that resulted in this */ UUIDs []string /* documents found for the latest query */ }
Result wraps the raw Solr response and provides simplified access to the original query and document uuids.
Click to show internal directories.
Click to hide internal directories.