Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
func (*Cursor) DocId ¶
func (c *Cursor) DocId() DocumentID
func (*Cursor) NextDoc ¶
func (c *Cursor) NextDoc(id DocumentID)
type DocumentID ¶
type DocumentID int64
type DocumentStore ¶
type DocumentStore struct {
// contains filtered or unexported fields
}
func NewDocumentStore ¶
func NewDocumentStore(db *sql.DB) *DocumentStore
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewSearchEngine ¶
type Index ¶
type Index struct {
Dictionary map[string]PostingsList
TotalDocsCount int
}
type IndexReader ¶
type IndexReader struct {
// contains filtered or unexported fields
}
func NewIndexReader ¶
func NewIndexReader(path string) *IndexReader
type IndexWriter ¶
type IndexWriter struct {
// contains filtered or unexported fields
}
func NewIndexWriter ¶
func NewIndexWriter(path string) *IndexWriter
func (*IndexWriter) Flush ¶
func (w *IndexWriter) Flush(index *Index) error
type Posting ¶
type Posting struct {
DocID DocumentID // ドキュメントID
Positions []int // 用語の出現位置
TermFrequency int // ドキュメント内の用語の出現回数
}
func NewPosting ¶
func NewPosting(docID DocumentID, positions ...int) *Posting
type PostingsList ¶
func NewPostingsList ¶
func NewPostingsList(postings ...*Posting) PostingsList
func (PostingsList) Add ¶
func (pl PostingsList) Add(new *Posting)
func (PostingsList) MarshalJSON ¶
func (pl PostingsList) MarshalJSON() ([]byte, error)
func (PostingsList) OpenCursor ¶
func (pl PostingsList) OpenCursor() *Cursor
func (PostingsList) String ¶
func (pl PostingsList) String() string
func (*PostingsList) UnmarshalJSON ¶
func (pl *PostingsList) UnmarshalJSON(b []byte) error
type ScoreDoc ¶
type ScoreDoc struct {
// contains filtered or unexported fields
}
ドキュメントIDそのドキュメントのスコアを保持する
type SearchResult ¶
type SearchResult struct {
DocID DocumentID
Score float64
Title string
}
func (*SearchResult) String ¶
func (r *SearchResult) String() string
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func NewSearcher ¶
type Tokenizer ¶
type Tokenizer struct{}
func NewTokenizer ¶
func NewTokenizer() *Tokenizer
func (*Tokenizer) TextToWordSequence ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.