indexer

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Path           string    `json:"path"`
	Filename       string    `json:"filename"`
	FilenameSub    string    `json:"filename_sub"`
	FilenamePrefix string    `json:"filename_prefix"`
	Body           string    `json:"body"`
	ContentType    string    `json:"content_type"`
	ModTime        time.Time `json:"mtime"`
	Size           int64     `json:"size"`
	Hash           string    `json:"hash"`
	ExifMake       string    `json:"exif_make,omitempty"`
	ExifModel      string    `json:"exif_model,omitempty"`
	ExifDateTime   string    `json:"exif_datetime,omitempty"`
	ExifLatitude   float64   `json:"exif_latitude,omitempty"`
	ExifLongitude  float64   `json:"exif_longitude,omitempty"`
	ExifISO        int       `json:"exif_iso,omitempty"`
	ExifFNumber    float64   `json:"exif_fnumber,omitempty"`
	ExifExposure   string    `json:"exif_exposure,omitempty"`
	ExifFocalLen   float64   `json:"exif_focal_length,omitempty"`
	XattrTags      []string  `json:"xattr_tags,omitempty"`
	DocType        string    `json:"doc_type"`
}

type FileEntry added in v0.2.0

type FileEntry struct {
	Path    string    `json:"path"`
	ModTime time.Time `json:"mod_time"`
	Size    int64     `json:"size"`
}

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) (*Indexer, error)

func (*Indexer) Close

func (i *Indexer) Close() error

func (*Indexer) Delete

func (i *Indexer) Delete(path string) error

func (*Indexer) GetDocCount added in v0.0.3

func (i *Indexer) GetDocCount() (uint64, error)

func (*Indexer) Index

func (i *Indexer) Index(path string) error

func (*Indexer) ListFiles added in v0.2.0

func (i *Indexer) ListFiles(prefix string, limit int) ([]FileEntry, int, error)

func (*Indexer) NeedsReindex added in v0.2.0

func (i *Indexer) NeedsReindex() bool

func (*Indexer) ReindexAll

func (i *Indexer) ReindexAll() error

func (*Indexer) SaveSchemaVersion added in v0.2.0

func (i *Indexer) SaveSchemaVersion() error

func (*Indexer) Search

func (i *Indexer) Search(query string, limit int) (*bleve.SearchResult, error)

func (*Indexer) SearchAll added in v0.2.0

func (i *Indexer) SearchAll(opts *SearchOptions) (*SearchResult, error)

func (*Indexer) SearchWithOptions

func (i *Indexer) SearchWithOptions(opts *SearchOptions) (*bleve.SearchResult, error)

func (*Indexer) Stats

func (i *Indexer) Stats() *config.IndexStats

func (*Indexer) SyncIncremental

func (i *Indexer) SyncIncremental() error

type SearchOptions

type SearchOptions struct {
	Query           string   `json:"query"`
	Limit           int      `json:"limit"`
	Field           string   `json:"field,omitempty"`
	ContentType     string   `json:"content_type,omitempty"`
	Extension       string   `json:"extension,omitempty"`
	Fuzzy           bool     `json:"fuzzy,omitempty"`
	SortBy          string   `json:"sort_by,omitempty"`
	SortDesc        bool     `json:"sort_desc,omitempty"`
	MinSize         int64    `json:"min_size,omitempty"`
	MaxSize         int64    `json:"max_size,omitempty"`
	ModifiedAfter   string   `json:"modified_after,omitempty"`
	Facets          []string `json:"facets,omitempty"`
	Folder          string   `json:"folder,omitempty"`
	ExifMake        string   `json:"exif_make,omitempty"`
	ExifModel       string   `json:"exif_model,omitempty"`
	ExifDateAfter   string   `json:"exif_date_after,omitempty"`
	ExifDateBefore  string   `json:"exif_date_before,omitempty"`
	ExifMinISO      int      `json:"exif_min_iso,omitempty"`
	ExifMaxISO      int      `json:"exif_max_iso,omitempty"`
	ExifMinAperture float64  `json:"exif_min_aperture,omitempty"`
	ExifMaxAperture float64  `json:"exif_max_aperture,omitempty"`
	ExifMinFocalLen float64  `json:"exif_min_focal_len,omitempty"`
	ExifMaxFocalLen float64  `json:"exif_max_focal_len,omitempty"`
	ExifLatMin      float64  `json:"exif_lat_min,omitempty"`
	ExifLatMax      float64  `json:"exif_lat_max,omitempty"`
	ExifLonMin      float64  `json:"exif_lon_min,omitempty"`
	ExifLonMax      float64  `json:"exif_lon_max,omitempty"`
	XattrTags       string   `json:"xattr_tags,omitempty"`
	Type            string   `json:"type,omitempty"`
}

type SearchResult added in v0.2.0

type SearchResult struct {
	*bleve.SearchResult
	DirectoryHits search.DocumentMatchCollection `json:"directory_hits,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL