-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmissing.go
More file actions
139 lines (107 loc) · 3.32 KB
/
missing.go
File metadata and controls
139 lines (107 loc) · 3.32 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Copyright 2016-Present Couchbase, Inc.
//
// Use of this software is governed by the Business Source License included
// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
// in that file, in accordance with the Business Source License, use of this
// software will be governed by the Apache License, Version 2.0, included in
// the file licenses/APL2.txt.
package cbft
import (
"context"
"errors"
"fmt"
"github.com/blevesearch/bleve/v2"
"github.com/blevesearch/bleve/v2/mapping"
index "github.com/blevesearch/bleve_index_api"
)
var missingPIndexUnimplementedErr = errors.New("unimplemented")
type MissingPIndex struct {
name string
}
func (m *MissingPIndex) Name() string {
return m.name
}
func (m *MissingPIndex) SetName(name string) {
m.name = name
}
func (m *MissingPIndex) Index(id string, data interface{}) error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) Delete(id string) error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) Batch(b *bleve.Batch) error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) Document(id string) (index.Document, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) DocCount() (uint64, error) {
return 0, nil
}
func (m *MissingPIndex) Search(req *bleve.SearchRequest) (
*bleve.SearchResult, error) {
return m.SearchInContext(context.Background(), req)
}
func (m *MissingPIndex) SearchInContext(ctx context.Context,
req *bleve.SearchRequest) (*bleve.SearchResult, error) {
return nil, fmt.Errorf("pindex not available")
}
func (m *MissingPIndex) Fields() ([]string, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) FieldDict(field string) (index.FieldDict, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) FieldDictRange(field string,
startTerm []byte, endTerm []byte) (index.FieldDict, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) FieldDictPrefix(field string,
termPrefix []byte) (index.FieldDict, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) DumpAll() chan interface{} {
return nil
}
func (m *MissingPIndex) DumpDoc(id string) chan interface{} {
return nil
}
func (m *MissingPIndex) DumpFields() chan interface{} {
return nil
}
func (m *MissingPIndex) Close() error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) Mapping() mapping.IndexMapping {
return nil
}
func (m *MissingPIndex) NewBatch() *bleve.Batch {
return nil
}
func (m *MissingPIndex) Stats() *bleve.IndexStat {
return nil
}
func (m *MissingPIndex) StatsMap() map[string]interface{} {
return nil
}
func (m *MissingPIndex) GetInternal(key []byte) ([]byte, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) SetInternal(key, val []byte) error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) DeleteInternal(key []byte) error {
return missingPIndexUnimplementedErr
}
func (m *MissingPIndex) Advanced() (index.Index, error) {
return nil, missingPIndexUnimplementedErr
}
func (m *MissingPIndex) TermFrequencies(field string, limit int, descending bool) (
[]index.TermFreq, error) {
return nil, nil
}
func (m *MissingPIndex) CentroidCardinalities(field string, limit int, descending bool) (
[]index.CentroidCardinality, error) {
return nil, nil
}