elastic

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TitleBoost boost value for the title field
	TitleBoost = 0.8

	// TagsBoost boost value for the tags field
	TagsBoost = 0.6

	// BodyBoost boost value for the body field
	BodyBoost = 0.5

	// MaxExpansions max expansion sets the limit on how many
	// documents the prefix max will match before returning. Prefix
	// matching is resource intensive.
	//
	// For more details see ElasticSearch's docs on "Query-Time Search-as-You-Type"
	MaxExpansions = 50

	// Slop how much slop to give when matching the order and position of the words
	// For more details see ElasticSearch's docs on "Query-Time Search-as-You-Type"
	Slop = 20
)

Functions

This section is empty.

Types

type Index

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

Index provides the interface to ElasticSearch

func NewIndex

func NewIndex(host, idxName string) (*Index, error)

NewIndex returns a new Index

func (*Index) DeleteBook

func (b *Index) DeleteBook(bk *note.Book) error

DeleteBook deletes all notes in the index for the notebook

func (*Index) DeleteIndex added in v0.5.0

func (b *Index) DeleteIndex() error

DeleteIndex deletes this index

func (*Index) DeleteNote

func (b *Index) DeleteNote(n *note.Note) error

DeleteNote deletes note from index

func (*Index) IndexNote

func (b *Index) IndexNote(n *note.Note) error

IndexNote creates or updates a note in ElasticSearch index

func (*Index) IndexNotes

func (b *Index) IndexNotes(notes note.Notes) error

IndexNotes creates or updates a list of notes in ElasticSearch index

func (*Index) SearchNote

func (b *Index) SearchNote(query string, limit, offset int) ([]int64, uint64, error)

SearchNote sends a search query to ElasticSearch using QueryStringQuery

func (*Index) SearchNotePhrase

func (b *Index) SearchNotePhrase(query string, bk *note.Book, sort string, limit, offset int) ([]int64, uint64, error)

SearchNotePhrase sends a search query to ElasticSearch using Phrase Prefix query If bk is given, only notes for that Book are queried.

Jump to

Keyboard shortcuts

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