@@ -51,7 +51,7 @@ TargetIndexMatcher::TargetIndexMatcher(const core::Target& target) {
51
51
}
52
52
}
53
53
54
- bool TargetIndexMatcher::ServedByIndex (const model::FieldIndex& index) {
54
+ bool TargetIndexMatcher::ServedByIndex (const model::FieldIndex& index) const {
55
55
HARD_ASSERT (index.collection_group () == collection_id_,
56
56
" Collection IDs do not match" );
57
57
@@ -118,7 +118,7 @@ bool TargetIndexMatcher::ServedByIndex(const model::FieldIndex& index) {
118
118
return true ;
119
119
}
120
120
121
- model::FieldIndex TargetIndexMatcher::BuildTargetIndex () {
121
+ model::FieldIndex TargetIndexMatcher::BuildTargetIndex () const {
122
122
// We want to make sure only one segment created for one field. For example,
123
123
// in case like a == 3 and a > 2, Index: {a ASCENDING} will only be created
124
124
// once.
@@ -175,7 +175,8 @@ model::FieldIndex TargetIndexMatcher::BuildTargetIndex() {
175
175
std::move (segments), FieldIndex::InitialState ());
176
176
}
177
177
178
- bool TargetIndexMatcher::HasMatchingEqualityFilter (const Segment& segment) {
178
+ bool TargetIndexMatcher::HasMatchingEqualityFilter (
179
+ const Segment& segment) const {
179
180
for (const auto & filter : equality_filters_) {
180
181
if (MatchesFilter (filter, segment)) {
181
182
return true ;
@@ -185,15 +186,16 @@ bool TargetIndexMatcher::HasMatchingEqualityFilter(const Segment& segment) {
185
186
}
186
187
187
188
bool TargetIndexMatcher::MatchesFilter (
188
- const absl::optional<core::FieldFilter>& filter, const Segment& segment) {
189
+ const absl::optional<core::FieldFilter>& filter,
190
+ const Segment& segment) const {
189
191
if (!filter.has_value ()) {
190
192
return false ;
191
193
}
192
194
return MatchesFilter (filter.value (), segment);
193
195
}
194
196
195
197
bool TargetIndexMatcher::MatchesFilter (const FieldFilter& filter,
196
- const Segment& segment) {
198
+ const Segment& segment) const {
197
199
if (filter.field () != segment.field_path ()) {
198
200
return false ;
199
201
}
@@ -204,7 +206,7 @@ bool TargetIndexMatcher::MatchesFilter(const FieldFilter& filter,
204
206
}
205
207
206
208
bool TargetIndexMatcher::MatchesOrderBy (const OrderBy& order_by,
207
- const Segment& segment) {
209
+ const Segment& segment) const {
208
210
if (order_by.field () != segment.field_path ()) {
209
211
return false ;
210
212
}
0 commit comments