Top-level document store that coordinates field indexes, search, highlighting, and serialization.
DocumentIndex
Top-level document store that coordinates field indexes, search, highlighting, and serialization.
Declaration
class DocumentIndex
Constructors
constructor
```ts
constructor(mapping: Record, documents: Record): DocumentIndex
```
Parameters:
- `mapping: Record`
- `documents: Record`Members
mapping
```ts
mapping: Record
```documents
```ts
documents: Record
```indexState
```ts
get indexState(): DocumentIndexState
```loadState
```ts
loadState(documentIndexState: DocumentIndexState): DocumentIndex
```
Parameters:
- `documentIndexState: DocumentIndexState`index
```ts
index(document: Document): void
```
Parameters:
- `document: Document`getFieldIndex
```ts
getFieldIndex(field: string): FieldIndex | undefined
```
Parameters:
- `field: string`get
```ts
get(id: string): Document | undefined
```
Parameters:
- `id: string`search
```ts
search(query: { hits: void }, from: number, limit: number): Promise
```
Parameters:
- `query: { hits: void }`
- `from: number`
- `limit: number`searchRequest
```ts
searchRequest(__namedParameters: SearchRequest): Promise
```
Parameters:
- `__namedParameters: SearchRequest`highlight
```ts
highlight(id: string, query: Query | undefined, __namedParameters: HighlightRequest): HighlightResult
```
Parameters:
- `id: string`
- `query: Query | undefined`
- `__namedParameters: HighlightRequest`count
```ts
count(request: SearchRequest): Promise
```
Parameters:
- `request: SearchRequest`ids
```ts
ids(): Set
```