Documentation ¶
Index ¶
Constants ¶
const DocumentEntityName = "Document"
DocumentEntityName is used to represent documents in storage.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct { Key string `gorm:"primaryKey"` Name string // The name of the resource. Fragment string // The path to the fragment of the resource, possibly empty. Kind string // The type of the resource. Field Field // The field of the resource or type of the fragment, if appropriate. ProjectID string // The project associated with the document and resource. Vector TSVector // A Text Search Vector of the indexed text. Raw string // The raw indexed text for excerpting; has excerpt from search result. Escaped bool // If true, the raw text is escaped. }
A document is an item stored in the search index that is a potential search result. A documents is typically a resource or part of a resource and when so, has a resource path and a possible path into the resource to the resource fragment corresponding to the document. Such a fragment might be an API operation or schema.
Documents have associated text that is used to index them. This text is derived from properties of the resource and is stored in two forms: a "vector" version that is created with the Postgres ts_vector function, and raw text that can be presented with the results of search queries. This raw text can be highlighted to show search terms.
The key of the document is derived from the resource name and the path to the resource fragment, when appropriate.
type TSVector ¶
TSVector opaquely represents the write-only ts_vector, containing the should-be-escaped text to index and the search weight.
func (TSVector) GormDataType ¶
GormDataType of TSVector is the Postgres column type "tsvector",