Skip to content

Commit

Permalink
Merge #606
Browse files Browse the repository at this point in the history
606: Feat/stabilize vector store r=Ja7ad a=Strift

# Pull Request

## Related issue
Fixes #605 

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Strift <[email protected]>
  • Loading branch information
meili-bors[bot] and Strift authored Feb 8, 2025
2 parents d13e738 + c32e59f commit 0e0d14a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 42 deletions.
6 changes: 0 additions & 6 deletions features.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ func (m *meilisearch) ExperimentalFeatures() *ExperimentalFeatures {
return &ExperimentalFeatures{client: m.client}
}

func (ef *ExperimentalFeatures) SetVectorStore(vectorStore bool) *ExperimentalFeatures {
ef.VectorStore = &vectorStore
return ef
}

func (ef *ExperimentalFeatures) SetLogsRoute(logsRoute bool) *ExperimentalFeatures {
ef.LogsRoute = &logsRoute
return ef
Expand Down Expand Up @@ -69,7 +64,6 @@ func (ef *ExperimentalFeatures) Update() (*ExperimentalFeaturesResult, error) {

func (ef *ExperimentalFeatures) UpdateWithContext(ctx context.Context) (*ExperimentalFeaturesResult, error) {
request := ExperimentalFeaturesBase{
VectorStore: ef.VectorStore,
LogsRoute: ef.LogsRoute,
Metrics: ef.Metrics,
EditDocumentsByFunction: ef.EditDocumentsByFunction,
Expand Down
2 changes: 0 additions & 2 deletions features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ func TestUpdate_ExperimentalFeatures(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ef := tt.client.ExperimentalFeatures()
ef.SetVectorStore(true)
ef.SetLogsRoute(true)
ef.SetMetrics(true)
ef.SetEditDocumentsByFunction(true)
ef.SetContainsFilter(true)
gotResp, err := ef.Update()
require.NoError(t, err)
require.Equal(t, true, gotResp.VectorStore, "ExperimentalFeatures.Update() should return vectorStore as true")
require.Equal(t, true, gotResp.LogsRoute, "ExperimentalFeatures.Update() should return logsRoute as true")
require.Equal(t, true, gotResp.Metrics, "ExperimentalFeatures.Update() should return metrics as true")
require.Equal(t, true, gotResp.EditDocumentsByFunction, "ExperimentalFeatures.Update() should return editDocumentsByFunction as true")
Expand Down
2 changes: 1 addition & 1 deletion index_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestIndex_GetTasks(t *testing.T) {
query: &TasksQuery{
IndexUIDS: []string{"indexUID"},
Limit: 10,
From: 1,
From: 0,
Statuses: []TaskStatus{TaskStatusSucceeded},
Types: []TaskType{TaskTypeDocumentAdditionOrUpdate},
},
Expand Down
3 changes: 2 additions & 1 deletion meilisearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,8 @@ func Test_ListIndex(t *testing.T) {

for _, idx := range tt.Indexes {
info, err := c.CreateIndex(&IndexConfig{
Uid: idx,
Uid: idx,
PrimaryKey: "id", // Adding a default primary key
})
if tt.WantErr {
require.Error(t, err)
Expand Down
2 changes: 0 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,13 @@ type UpdateDocumentByFunctionRequest struct {

// ExperimentalFeaturesResult represents the experimental features result from the API.
type ExperimentalFeaturesBase struct {
VectorStore *bool `json:"vectorStore,omitempty"`
LogsRoute *bool `json:"logsRoute,omitempty"`
Metrics *bool `json:"metrics,omitempty"`
EditDocumentsByFunction *bool `json:"editDocumentsByFunction,omitempty"`
ContainsFilter *bool `json:"containsFilter,omitempty"`
}

type ExperimentalFeaturesResult struct {
VectorStore bool `json:"vectorStore"`
LogsRoute bool `json:"logsRoute"`
Metrics bool `json:"metrics"`
EditDocumentsByFunction bool `json:"editDocumentsByFunction"`
Expand Down
33 changes: 3 additions & 30 deletions types_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e0d14a

Please sign in to comment.