Documentation ¶
Index ¶
- Constants
- type Document
- type Search
- func (s Search) AddResources(resources []string) ([]Document, error)
- func (s Search) Delete(urls []string) ([]string, error)
- func (s Search) MatchAll() ([]Document, error)
- func (s Search) Query(q string) ([]Document, error)
- func (s Search) QueryWithHighlight(q string, highlight string) ([]Document, error)
Constants ¶
const ( ID = "ID" Body = "Body" URL = "URL" )
Named Document fields for simple referencing
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
Document represents an indexed HTML article within our content index.
func Convert ¶
Convert attempts to follow the URLs provided as resources fetch them over the network, and parse them into Documents.
func (Document) EscapeBody ¶
EscapeBody formats the Body field of Document d, preserving any highlights which may have been added during document searching so that they may be displayed as-is in HTML format.
type Search ¶
type Search struct { IndexPath string // contains filtered or unexported fields }
Search encapsulates the requisite state necessary to query and augment our Document index
func NewSearch ¶
NewSearch initializes the internal state of a Search type returning a ready to use reference
func (Search) AddResources ¶
AddResources downloads the HTML corresponding to the resources provided and after parsing them into Documents indexes them for later retrieval.
func (Search) MatchAll ¶
MatchAll performs a bleve.NewMatchAllQuery, returning all Documents in our index.