Skip to content

Commit

Permalink
OptimizeTopK available since 3.12 (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
informalict committed May 24, 2023
1 parent 9926b07 commit 247a74e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/index_ensure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func TestEnsureInvertedIndex(t *testing.T) {
},
{
IsEE: true,
minVersion: driver.Version("3.11.0"),
minVersion: driver.Version("3.12.0"),
Options: driver.InvertedIndexOptions{
Name: "inverted-opt-optimize-top-k",
PrimarySort: driver.InvertedIndexPrimarySort{
Expand Down Expand Up @@ -621,7 +621,7 @@ func TestEnsureInvertedIndex(t *testing.T) {
require.Equal(t, tc.Options.Fields, invertedIdx.InvertedIndexOptions().Fields)

t.Run("optimizeTopK", func(t *testing.T) {
skipBelowVersion(c, "3.11.0", t)
skipBelowVersion(c, "3.12.0", t)
// OptimizeTopK can be nil or []string{} depends on the version, so it better to check length.
if len(tc.Options.OptimizeTopK) > 0 || len(invertedIdx.InvertedIndexOptions().OptimizeTopK) > 0 {
require.Equal(t, tc.Options.OptimizeTopK, invertedIdx.InvertedIndexOptions().OptimizeTopK)
Expand Down

0 comments on commit 247a74e

Please sign in to comment.