searchends

package
v0.0.0-...-301923a Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Driver name strings
	DriverElastic = "elastic"
	DriverBleve   = "bleve"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticV6

type ElasticV6 struct {
	// contains filtered or unexported fields
}

func (*ElasticV6) Close

func (e *ElasticV6) Close() error

Kill connection to remote host(s)

func (*ElasticV6) DeleteCollection

func (e *ElasticV6) DeleteCollection(ids ...string) error

Delete collections by ID(s)

func (*ElasticV6) DeleteItem

func (e *ElasticV6) DeleteItem(ids ...string) error

Delete items by ID(s)

func (e *ElasticV6) DeleteLink(ids ...string) error

Delete links by ID(s)

func (*ElasticV6) DeleteResource

func (e *ElasticV6) DeleteResource(ids ...string) error

Delete resources by ID(s)

func (*ElasticV6) DeleteVersion

func (e *ElasticV6) DeleteVersion(ids ...string) error

Delete versions by ID(s)

func (*ElasticV6) InsertCollection

func (e *ElasticV6) InsertCollection(id string, in *wyc.Collection) error

Insert collection using the given id

func (*ElasticV6) InsertItem

func (e *ElasticV6) InsertItem(id string, in *wyc.Item) error

Insert collection using the given id

func (e *ElasticV6) InsertLink(id string, in *wyc.Link) error

Insert link using the given id

func (*ElasticV6) InsertResource

func (e *ElasticV6) InsertResource(id string, in *wyc.Resource) error

Insert resource using the given id

func (*ElasticV6) InsertVersion

func (e *ElasticV6) InsertVersion(id string, in *wyc.Version) error

Insert version using the given id

func (*ElasticV6) QueryCollection

func (e *ElasticV6) QueryCollection(limit, offset int, in ...*wyc.QueryDesc) ([]string, error)

Query for collections

int: 'limit' results to at most int (where 0 indicates there is no limit)
int: 'from' what number to start returning results from
...QueryDes: description(s) of what to search for

Ids will be returned for any doc matching all of the fields of any of the given QueryDesc

func (*ElasticV6) QueryItem

func (e *ElasticV6) QueryItem(limit, offset int, in ...*wyc.QueryDesc) ([]string, error)

Query for items

int: 'limit' results to at most int (where 0 indicates there is no limit)
int: 'from' what number to start returning results from
...QueryDes: description(s) of what to search for

Ids will be returned for any doc matching all of the fields of any of the given QueryDesc

func (e *ElasticV6) QueryLink(limit, offset int, in ...*wyc.QueryDesc) ([]string, error)

Query for links

int: 'limit' results to at most int (where 0 indicates there is no limit)
int: 'from' what number to start returning results from
...QueryDes: description(s) of what to search for

Ids will be returned for any doc matching all of the fields of any of the given QueryDesc

func (*ElasticV6) QueryResource

func (e *ElasticV6) QueryResource(limit, offset int, in ...*wyc.QueryDesc) ([]string, error)

Query for resources

int: 'limit' results to at most int (where 0 indicates there is no limit)
int: 'from' what number to start returning results from
...QueryDes: description(s) of what to search for

Ids will be returned for any doc matching all of the fields of any of the given QueryDesc

func (*ElasticV6) QueryVersion

func (e *ElasticV6) QueryVersion(limit, offset int, in ...*wyc.QueryDesc) ([]string, error)

Query for versions

int: 'limit' results to at most int (where 0 indicates there is no limit)
int: 'from' what number to start returning results from
...QueryDes: description(s) of what to search for

Ids will be returned for any doc matching all of the fields of any of the given QueryDesc

func (*ElasticV6) UpdateCollection

func (e *ElasticV6) UpdateCollection(id string, doc *wyc.Collection) error

Update collection with given id

func (*ElasticV6) UpdateItem

func (e *ElasticV6) UpdateItem(id string, doc *wyc.Item) error

Update item with given id

func (e *ElasticV6) UpdateLink(id string, doc *wyc.Link) error

Update link with given id

func (*ElasticV6) UpdateResource

func (e *ElasticV6) UpdateResource(id string, doc *wyc.Resource) error

Update resource with given id

func (*ElasticV6) UpdateVersion

func (e *ElasticV6) UpdateVersion(id string, doc *wyc.Version) error

Update version with given id

type Searchbase

type Searchbase interface {
	// Kill connection to remote host(s)
	Close() error

	// Insert collection into the sb with the given Id
	InsertCollection(string, *wyc.Collection) error

	// Insert item into the sb with the given Id
	InsertItem(string, *wyc.Item) error

	// Insert version into the sb with the given Id
	InsertVersion(string, *wyc.Version) error

	// Insert resource into the sb with the given Id
	InsertResource(string, *wyc.Resource) error

	// Insert link into the sb with the given Id
	InsertLink(string, *wyc.Link) error

	// Update the facets of the collection with the given id with the given facets
	UpdateCollection(string, *wyc.Collection) error

	// Update the facets of the resource with the given id with the given facets
	UpdateResource(string, *wyc.Resource) error

	// Update the facets of the link with the given id with the given facets
	UpdateLink(string, *wyc.Link) error

	// Update the facets of the item with the given id with the given facets
	UpdateItem(string, *wyc.Item) error

	// Update the facets of the version with the given id with the given facets
	UpdateVersion(string, *wyc.Version) error

	// Delete collection search data by Id(s)
	//  Note that deleting something and making it unavailable to search for effectively means
	//  that the server will never return the data for it, even if it still exists in the database.
	DeleteCollection(...string) error

	// Delete item search data by Id(s)
	DeleteItem(...string) error

	// Delete version search data by Id(s)
	DeleteVersion(...string) error

	// Delete resource search data by Id(s)
	DeleteResource(...string) error

	// Delete link search data by Id(s)
	DeleteLink(...string) error

	// Query for collections
	//  int: 'limit' results to at most int (where 0 indicates there is no limit)
	//  int: 'from' what number to start returning results from
	//  ...QueryDes: description(s) of what to search for
	// Ids will be returned for any doc matching all of the fields of any of the given QueryDesc
	QueryCollection(int, int, ...*wyc.QueryDesc) ([]string, error)

	// Query for items
	//  int: 'limit' results to at most int (where 0 indicates there is no limit)
	//  int: 'from' what number to start returning results from
	//  ...QueryDes: description(s) of what to search for
	// Ids will be returned for any doc matching all of the fields of any of the given QueryDesc
	QueryItem(int, int, ...*wyc.QueryDesc) ([]string, error)

	// Query for versions
	//  int: 'limit' results to at most int (where 0 indicates there is no limit)
	//  int: 'from' what number to start returning results from
	//  ...QueryDes: description(s) of what to search for
	// Ids will be returned for any doc matching all of the fields of any of the given QueryDesc
	QueryVersion(int, int, ...*wyc.QueryDesc) ([]string, error)

	// Query for resources
	//  int: 'limit' results to at most int (where 0 indicates there is no limit)
	//  int: 'from' what number to start returning results from
	//  ...QueryDes: description(s) of what to search for
	// Ids will be returned for any doc matching all of the fields of any of the given QueryDesc
	QueryResource(int, int, ...*wyc.QueryDesc) ([]string, error)

	// Query for links
	//  int: 'limit' results to at most int (where 0 indicates there is no limit)
	//  int: 'from' what number to start returning results from
	//  ...QueryDes: description(s) of what to search for
	// Ids will be returned for any doc matching all of the fields of any of the given QueryDesc
	QueryLink(int, int, ...*wyc.QueryDesc) ([]string, error)
}

Interface to a data store whose primary goal is running search queries rather than storage.

func Connect

func Connect(settings *Settings) (Searchbase, error)

Return a connect function for the given settings, or err if it can't be found

type Settings

type Settings struct {
	Driver         string
	Host           string
	Port           int
	User           string
	Pass           string
	Database       string
	PemFile        string
	ReindexOnWrite bool
}

Settings that will be provided to a searchbase implementation on creation

Jump to

Keyboard shortcuts

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