Skip to content

Commit

Permalink
Merge pull request #606 from meilisearch/feat/stabilize-vector-store
Browse files Browse the repository at this point in the history
Feat/stabilize vector store
  • Loading branch information
Ja7ad authored Feb 8, 2025
2 parents d13e738 + c32e59f commit e45f65d
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 e45f65d

Please sign in to comment.