glsolr

package module
v0.0.0-...-3e4420a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2018 License: MIT Imports: 8 Imported by: 2

README

glsolr

Go Report Card

glsolr is the lightweight golang library wrapper for some functionality of Solr API.

Feauteres

  • Select query.
  • Cursor select query.
License

glsolr is released under the MIT License. See LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CursorSelect

func CursorSelect(cLink, user, passw string, params url.Values, headers map[string]string, client *http.Client) (<-chan interface{}, error)

CursorSelect returns generator as channel to receive results of a cursor select query or error

Types

type Response

type Response struct {
	ResponseHeader struct {
		ZkConnected bool `json:"zkConnected"`
		Status      int  `json:"status"`
		QTime       int  `json:"QTime"`
		Params      struct {
			Q          string `json:"q"`
			Fl         string `json:"fl"`
			CursorMark string `json:"cursorMark"`
			Sort       string `json:"sort"`
			Rows       string `json:"rows"`
			Start      string `json:"start"`
		} `json:"params"`
	} `json:"responseHeader"`

	Error struct {
		Msg   string `json:"msg"`
		Trace string `json:"trace"`
	} `json:"error"`

	Response struct {
		NumFound int64             `json:"numFound"`
		Start    int64             `json:"start"`
		Docs     []json.RawMessage `json:"docs"`
	} `json:"response"`

	NextCursorMark string          `json:"nextCursorMark"`
	Highlighting   json.RawMessage `json:"highlighting"`
}

Response realizes format of Solr response

func Select

func Select(cLink, user, passw string, params url.Values, headers map[string]string, client *http.Client) (solrResp *Response, err error)

Select makes select request to a Solr collection

func Update

func Update(cLink, user, passw string, data io.Reader, params url.Values, headers map[string]string, client *http.Client) (solrResp *Response, err error)

Update func makes update request to a Solr collection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL