fulltext

package
v0.0.0-...-22804f9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2012 License: BSD-2-Clause-Views Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeywords

func GenerateKeywords(s string) []string

func GenerateQuery

func GenerateQuery(s string) []interface{}

Generates [{"fulltext": \^keyword1\}, {"fulltext": \^keyword2\}] With this query we can create a good enough full text search, which can search at the beginning of the keywords. We could write regexes which searches in the middle of the words too, but that query could not uzilize the btree indexes of mongodb. This solution must be efficient, assuming mongodb does the expected sane things: utilizing indexes with ^ regexes, "$and" queries and arrays.

Types

type C

type C struct {
}

func (*C) ProcessMap

func (c *C) ProcessMap(inp map[string]interface{})

func (*C) RegenerateFulltext

func (c *C) RegenerateFulltext(a iface.Filter) error

func (*C) SaveFulltext

func (c *C) SaveFulltext(a iface.Filter) error

Jump to

Keyboard shortcuts

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