Documentation
¶
Index ¶
- func Iterate(iterator PostingListIterator) iter.Seq[DocID]
- type AndQuery
- type DocID
- type FieldValueExtractor
- type InvertedIndex
- func (idx *InvertedIndex[DOCUMENT]) Add(doc DOCUMENT) bool
- func (idx *InvertedIndex[DOCUMENT]) AddAll(docs iter.Seq[DOCUMENT]) (added bool)
- func (idx *InvertedIndex[DOCUMENT]) Docs() iter.Seq[DOCUMENT]
- func (idx *InvertedIndex[DOCUMENT]) Query(query Query[DOCUMENT]) iter.Seq[DOCUMENT]
- func (idx *InvertedIndex[DOCUMENT]) Remove(doc DOCUMENT) bool
- func (idx *InvertedIndex[DOCUMENT]) RemoveAll(docs iter.Seq[DOCUMENT]) (removed bool)
- type InvertedIndexField
- type OrQuery
- type PostingList
- type PostingListIterator
- type Query
- type QueryBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AndQuery ¶
type AndQuery[DOCUMENT comparable] []Query[DOCUMENT]
type FieldValueExtractor ¶
type FieldValueExtractor[DOCUMENT comparable] interface { // contains filtered or unexported methods }
type InvertedIndex ¶
type InvertedIndex[DOCUMENT comparable] struct { // contains filtered or unexported fields }
func NewInvertedIndex ¶
func NewInvertedIndex[DOCUMENT comparable](fields ...FieldValueExtractor[DOCUMENT]) *InvertedIndex[DOCUMENT]
func (*InvertedIndex[DOCUMENT]) Add ¶
func (idx *InvertedIndex[DOCUMENT]) Add(doc DOCUMENT) bool
func (*InvertedIndex[DOCUMENT]) AddAll ¶ added in v0.0.1
func (idx *InvertedIndex[DOCUMENT]) AddAll(docs iter.Seq[DOCUMENT]) (added bool)
func (*InvertedIndex[DOCUMENT]) Docs ¶ added in v0.0.1
func (idx *InvertedIndex[DOCUMENT]) Docs() iter.Seq[DOCUMENT]
func (*InvertedIndex[DOCUMENT]) Query ¶
func (idx *InvertedIndex[DOCUMENT]) Query(query Query[DOCUMENT]) iter.Seq[DOCUMENT]
func (*InvertedIndex[DOCUMENT]) Remove ¶
func (idx *InvertedIndex[DOCUMENT]) Remove(doc DOCUMENT) bool
type InvertedIndexField ¶
type InvertedIndexField[DOCUMENT, FIELD comparable] struct { // contains filtered or unexported fields }
func NewInvertedIndexField ¶
func NewInvertedIndexField[DOCUMENT, FIELD comparable]( extractFieldValues func(doc DOCUMENT, f func(value FIELD)), ) *InvertedIndexField[DOCUMENT, FIELD]
func (*InvertedIndexField[DOCUMENT, FIELD]) Query ¶
func (f *InvertedIndexField[DOCUMENT, FIELD]) Query(value FIELD) Query[DOCUMENT]
type OrQuery ¶
type OrQuery[DOCUMENT comparable] []Query[DOCUMENT]
type PostingList ¶
type PostingList struct {
// contains filtered or unexported fields
}
func NewPostingList ¶
func NewPostingList() *PostingList
func (*PostingList) Add ¶
func (pl *PostingList) Add(docID DocID)
Add adds the given DocID to the end of the posting list. Noop if the given DocID is already in the posting list.
func (*PostingList) Iterator ¶
func (pl *PostingList) Iterator() PostingListIterator
func (*PostingList) Remove ¶
func (pl *PostingList) Remove(docID DocID) bool
Remove removes the given element from the list. Noop if the element was not already present. Returns true if the list is empty.
type PostingListIterator ¶
var EmptyIterator PostingListIterator = new(listIterator)
func NewAndIterator ¶
func NewAndIterator(left, right PostingListIterator) PostingListIterator
func NewNotIterator ¶
func NewNotIterator(positive, negative PostingListIterator) PostingListIterator
func NewOrIterator ¶
func NewOrIterator(left, right PostingListIterator) PostingListIterator
type Query ¶
type Query[DOCUMENT comparable] interface { // contains filtered or unexported methods }
func NewAndQuery ¶
func NewAndQuery[DOCUMENT comparable](ands ...Query[DOCUMENT]) Query[DOCUMENT]
func NewNotQuery ¶
func NewNotQuery[DOCUMENT comparable](positive, negative Query[DOCUMENT]) Query[DOCUMENT]
func NewOrQuery ¶
func NewOrQuery[DOCUMENT comparable](ors ...Query[DOCUMENT]) Query[DOCUMENT]
type QueryBuilder ¶
type QueryBuilder[DOCUMENT, FIELD comparable] func(FIELD) Query[DOCUMENT]
Click to show internal directories.
Click to hide internal directories.