Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 2ff707e

Browse files
authored
search: remove search-hybrid flag (#57507)
In our last release (5.1) we actually made this feature flag unused, but did not remove the final references to it. Additionally we add a CHANGELOG entry for the removal to the 5.1 section. This is quite a minor change, so I don't think its worth calling out even though 5.1 has already been released. Test Plan: CI
1 parent 6c70bc1 commit 2ff707e

File tree

8 files changed

+93
-125
lines changed

8 files changed

+93
-125
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ All notable changes to Sourcegraph are documented in this file.
8080
- indexed-search has removed the deprecated environment variable ZOEKT_ENABLE_LAZY_DOC_SECTIONS [zoekt#620](https://github.com/sourcegraph/zoekt/pull/620)
8181
- The federation feature that could redirect users from their own Sourcegraph instance to public repositories on Sourcegraph.com has been removed. It allowed users to open a repository URL on their own Sourcegraph instance and, if the repository wasn't found on that instance, the user would be redirect to the repository on Sourcegraph.com, where it was possibly found. The feature has been broken for over a year though and we don't know that it was used. If you want to use it, please open a feature-request issue and tag the `@sourcegraph/source` team. [#55161](https://github.com/sourcegraph/sourcegraph/pull/55161)
8282
- The `applySearchQuerySuggestionOnEnter` experimental feature flag in user settings was removed, and this behavior is now always enabled. Previously, this behavior was on by default, but it was possible to disable it.
83+
- The feature-flag `search-hybrid`, which allowed to disable the performance improvements for unindexed search in 4.3, is now deprecated and will not be read anymore. [#56470](https://github.com/sourcegraph/sourcegraph/pull/56470)
8384

8485
## 5.1.9
8586

cmd/searcher/protocol/searcher.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ type Request struct {
5252
// Whether the revision to be searched is indexed or unindexed. This matters for
5353
// structural search because it will query Zoekt for indexed structural search.
5454
Indexed bool
55-
56-
// NOTE: This field is no longer read. It is always assumed to be true.
57-
//
58-
// FeatHybrid is a feature flag which enables hybrid search. Hybrid search
59-
// will only search what has changed since Zoekt has indexed as well as
60-
// including Zoekt results.
61-
FeatHybrid bool `json:"feat_hybrid,omitempty"`
6255
}
6356

6457
// PatternInfo describes a search request on a repo. Most of the fields
@@ -205,7 +198,6 @@ func (r *Request) ToProto() *proto.SearchRequest {
205198
Select: r.PatternInfo.Select,
206199
},
207200
FetchTimeout: durationpb.New(r.FetchTimeout),
208-
FeatHybrid: r.FeatHybrid,
209201
}
210202
}
211203

@@ -235,7 +227,6 @@ func (r *Request) FromProto(req *proto.SearchRequest) {
235227
},
236228
FetchTimeout: req.FetchTimeout.AsDuration(),
237229
Indexed: req.Indexed,
238-
FeatHybrid: req.FeatHybrid,
239230
}
240231
}
241232

internal/search/client/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ func ToFeatures(flagSet *featureflag.FlagSet, logger log.Logger) *search.Feature
295295

296296
return &search.Features{
297297
ContentBasedLangFilters: flagSet.GetBoolOr("search-content-based-lang-detection", false),
298-
HybridSearch: flagSet.GetBoolOr("search-hybrid", true), // can remove flag in 4.5
299298
Debug: flagSet.GetBoolOr("search-debug", false),
300299
}
301300
}

internal/search/searcher/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ func Search(
7171
},
7272
Indexed: indexed,
7373
FetchTimeout: fetchTimeout,
74-
FeatHybrid: features.HybridSearch, // TODO(keegan) HACK because I didn't want to change the signatures to so many function calls.
7574
}
7675

7776
body, err := json.Marshal(r)

internal/search/searcher/client_grpc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func SearchGRPC(
6060
},
6161
Indexed: indexed,
6262
FetchTimeout: fetchTimeout,
63-
FeatHybrid: features.HybridSearch, // TODO(keegan) HACK because I didn't want to change the signatures to so many function calls.
6463
}).ToProto()
6564

6665
// Searcher caches the file contents for repo@commit since it is

internal/search/types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,6 @@ type Features struct {
416416
// currently just supported by Zoekt.
417417
ContentBasedLangFilters bool `json:"search-content-based-lang-detection"`
418418

419-
// HybridSearch when true will consult the Zoekt index when running
420-
// unindexed searches. Searcher (unindexed search) will the only search
421-
// what has changed since the indexed commit.
422-
HybridSearch bool `json:"search-hybrid"`
423-
424419
// Debug when true will set the Debug field on FileMatches. This may grow
425420
// from here. For now we treat this like a feature flag for convenience.
426421
Debug bool `json:"debug"`

internal/searcher/v1/searcher.pb.go

Lines changed: 90 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/searcher/v1/searcher.proto

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ service SearcherService {
1414

1515
// SearchRequest is set of parameters for a search.
1616
message SearchRequest {
17+
reserved 9;
18+
1719
// repo is the name of the repo to search (e.g. "github.com/gorilla/mux")
1820
string repo = 1;
1921

@@ -54,11 +56,6 @@ message SearchRequest {
5456
// fetch will still happen in the background so future requests don't
5557
// have to wait.
5658
google.protobuf.Duration fetch_timeout = 8;
57-
58-
// feat_hybrid is a feature flag which enables hybrid search.
59-
// Hybrid search will only search what has changed since Zoekt has
60-
// indexed as well as including Zoekt results.
61-
bool feat_hybrid = 9;
6259
}
6360

6461
// SearchResponse is a message in the response stream for Search

0 commit comments

Comments
 (0)