indextest

package
v0.0.0-...-7b67181 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestFindByID

func TestFindByID(t *testing.T, idx index.Indexer)

TestFindByID verifies the document lookup logic.

func TestIndexDocument

func TestIndexDocument(t *testing.T, idx index.Indexer)

TestIndexDocument verifies the indexing logic for new and existing documents.

func TestIndexDoesNotOverridePageRank

func TestIndexDoesNotOverridePageRank(t *testing.T, idx index.Indexer)

func TestMatchSearch

func TestMatchSearch(t *testing.T, idx index.Indexer)

TestMatchSearch verifies the document search logic when searching for keyword matches.

func TestMatchSearchWithOffset

func TestMatchSearchWithOffset(t *testing.T, idx index.Indexer)

TestMatchSearchWithOffset verifies the document search logic when searching for keyword matches and skipping some results.

func TestPhraseSearch

func TestPhraseSearch(t *testing.T, idx index.Indexer)

TestPhraseSearch verifies the document search logic when searching for exact phrases.

func TestUpdateScore

func TestUpdateScore(t *testing.T, idx index.Indexer)

TestUpdateScore checks that PageRank score updates work as expected.

func TestUpdateScoreForUnknownDocument

func TestUpdateScoreForUnknownDocument(t *testing.T, idx index.Indexer)

TestUpdateScoreForUnknownDocument checks that a placeholder document will be created when setting the PageRank score for an unknown document.

Types

type Suite

type Suite struct {
	Idx index.Indexer

	// Optional helper functions.
	BeforeEach func(t *testing.T)
	AfterEach  func(t *testing.T)
}

Suite defines a re-usable set of index-related tests that can be executed against any type that implements index.Indexer.

func (*Suite) TestIndexer

func (s *Suite) TestIndexer(t *testing.T)

TestIndexer runs all the below functions on the index.

Jump to

Keyboard shortcuts

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