aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/memoryindex/i_field_index_insert_listener.h
blob: cf9dcee2f5799ee7c2a2f26c1caf0faacf09f8da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/datastore/entryref.h>

namespace search::memoryindex {

/**
 * Interface used to track which {wordRef, docId} pairs that are inserted into a FieldIndex.
 */
class IFieldIndexInsertListener {
public:
    virtual ~IFieldIndexInsertListener() {}

    /**
     * Called when a {wordRef, docId} tuple is inserted into the field index.
     */
    virtual void insert(vespalib::datastore::EntryRef wordRef, uint32_t docId) = 0;

    /**
     * Called to process the set of {wordRef, docId} tuples inserted since last flush().
     */
    virtual void flush() = 0;
};

}