Options
All
  • Public
  • Public/Protected
  • All
Menu

Single execution of a SearchDefinition.

Hierarchy

  • Search

Implements

  • IDbStorable

Index

Constructors

constructor

Properties

definition

definition: SearchDefinition

endedAt

endedAt: null | Date = null

events

events: EventEmitter = ...

id

id: string

lastSiteIndex

lastSiteIndex: number = 0

lastUserNameIndex

lastUserNameIndex: number = 0

results

results: AutoSearchAccount[] = ...

resultsMap is the best structure for storing and checking results internally during search, but is kind of messy to iterate over after.

Provide flattened alternatives that make it easier to get the data.

Since we don't really need to remove or reorder, this isn't too painful to manage.

If it's too memory intensive, we can reevaluate.

resultsById

resultsById: SearchResultsById = ...

resultsBySite

resultsBySite: SearchResultsBySite = ...

resultsByUser

resultsByUser: SearchResultsByUser = ...

resultsMap

resultsMap: SearchResults = ...

rev

rev: string = ''

startedAt

startedAt: null | Date = null

state

state: SearchState = ...

Static cache

cache: DbCache<Search> = ...

Accessors

evaluatedResults

inconclusiveResults

progress

  • get progress(): number

registeredResults

searches

  • get searches(): {}

unevaluatedResults

unregisteredResults

Methods

cancel

  • cancel(): Promise<void>

Protected doSearch

  • doSearch(): Promise<void>
  • Perform the search for each definition.includedSites.

    This is incremental. It won't duplicate sites that already have results.

    Returns Promise<void>

pause

  • pause(): Promise<void>

remove

  • remove(): Promise<void>

resume

  • resume(): Promise<void>

save

  • save(): Promise<Response>
  • Save/update this search in the database.

    Don't call this unless you've made changes! Each call will create a revision and take up space.

    Returns Promise<Response>

serialize

  • serialize(): SearchSchema

start

  • start(): Promise<void>

Protected storeResult

  • Store the resulting account where it needs to go.

    Won't overwrite/duplicate accounts whose keys already appear in resultsMap (noop for those).

    Parameters

    Returns void

Static deserialize

  • deserialize(data: SearchSchema, existingInstance?: Search): Promise<Search>

Static loadAll

  • loadAll(idPrefix?: string): Promise<Search[]>
  • This won't return anything unless you pass a searchDefinition prefix!

    Load all Searchs from the database into the Search.cache.

    Returns an array of the requested searches. All loaded searches (including ones not loaded by this request) can be accessed via Search.cache.

    Parameters

    • Optional idPrefix: string

    Returns Promise<Search[]>

Generated using TypeDoc