search

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package search creates a local search index of a repo using the bleve search engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexRepo

func IndexRepo(ctx context.Context, r repo.Repo, i bleve.Index) error

IndexRepo calculates an index for a given repository

func Search(i Index, p repo.SearchParams) ([]repo.DatasetRef, error)

Search searches this repo's bleve index

Types

type Index

type Index bleve.Index

Index is an index of search data

func LoadIndex

func LoadIndex(indexPath string) (Index, error)

LoadIndex loads the search index

type IndexableMetadata

type IndexableMetadata struct {
	Category      string `json:"category"`
	Title         string `json:"title"`
	Description   string `json:"description"`
	Kind          string `json:"kind"`
	ExternalScore int    `json:"externalScore"`
	// contains filtered or unexported fields
}

IndexableMetadata specifies the subset of fields we want to keep from a dataset's metadata file to be used in the bleveindex ExternalScore and internalScore are placeholders for future use.

func NewIndexableMetadataStruct

func NewIndexableMetadataStruct() *IndexableMetadata

NewIndexableMetadataStruct sets the default variable used to identify document type to 'table'

func (*IndexableMetadata) MapValues

func (imd *IndexableMetadata) MapValues() map[string]interface{}

MapValues converts the IndexableMetadata back to type map[string]interface{}

Jump to

Keyboard shortcuts

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