Documentation ¶
Index ¶
- Constants
- Variables
- func DisOrFirst(tie float32, q []iq.Query) iq.Query
- func OrOrFirst(q []iq.Query) iq.Query
- type Document
- type Shard
- func (s *Shard) BulkUpsert(batch []*Document)
- func (s *Shard) Close()
- func (s *Shard) MakeQuery(field string, query string) iq.Query
- func (s *Shard) ReadWeight(did int32) int32
- func (s *Shard) Reindex(batchSize int)
- func (s *Shard) Upsert(tx *gorm.DB, in *Document) *Document
- func (s *Shard) WriteWeight(did int32, w int32) error
- type Store
Constants ¶
View Source
const MAX_CHUNKS = 32
Variables ¶
View Source
var DefaultAnalyzer = analyzer.NewAnalyzer(DefaultNormalizer, DefaultSearchTokenizer, DefaultIndexTokenizer)
View Source
var DefaultIndexTokenizer = []tokenize.Tokenizer{ tokenize.NewCustom(prefixLine), tokenize.NewUnique(), }
haha this is extreme hack
View Source
var DefaultNormalizer = []norm.Normalizer{norm.NewCustom(ascii)}
View Source
var DefaultSearchTokenizer = []tokenize.Tokenizer{ tokenize.NewWhitespace(), }
View Source
var MAX_TOKEN_SIZE = 10
View Source
var N_SHARDS = uint32(16)
having 16 shards for stackoverflow means 2.5 million documents per shard
Functions ¶
Types ¶
type Document ¶
type Document struct { RowID int32 `gorm:"primary_key;auto_increment:true;not null"` ObjectID string `gorm:"unique_index"` Title string `json:"title,omitempty"` Body []byte `json:"body,omitempty"` Tags string `json:"tags,omitempty"` Popularity int `json:"popularity,omitempty"` Indexed int32 `gorm:"index:idx_indexed"` }
func (*Document) DocumentID ¶
func (*Document) IndexableFields ¶
Click to show internal directories.
Click to hide internal directories.