fix(typesense): fix reindexing views and positions in typesense
This commit is contained in:
parent
75f830457b
commit
cb648e5ad8
@ -146,22 +146,10 @@ func CreateTypesenseCollections() error {
|
|||||||
Name: "updated",
|
Name: "updated",
|
||||||
Type: "int64", // unix timestamp
|
Type: "int64", // unix timestamp
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "bucket_id",
|
|
||||||
Type: "int64",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "position",
|
|
||||||
Type: "float",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "created_by_id",
|
Name: "created_by_id",
|
||||||
Type: "int64",
|
Type: "int64",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "project_view_id",
|
|
||||||
Type: "int64",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "reminders",
|
Name: "reminders",
|
||||||
Type: "object[]", // TODO
|
Type: "object[]", // TODO
|
||||||
@ -192,6 +180,10 @@ func CreateTypesenseCollections() error {
|
|||||||
Type: "object[]", // TODO
|
Type: "object[]", // TODO
|
||||||
Optional: pointer.True(),
|
Optional: pointer.True(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "positions",
|
||||||
|
Type: "object",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,6 +378,12 @@ func indexDummyTask() (err error) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Positions: map[string]float64{
|
||||||
|
"view_1": 10,
|
||||||
|
"view_2": 30,
|
||||||
|
"view_3": 5450,
|
||||||
|
"view_4": 42,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = typesenseClient.Collection("tasks").
|
_, err = typesenseClient.Collection("tasks").
|
||||||
@ -461,6 +459,7 @@ func convertTaskToTypesenseTask(task *Task, positions []*TaskPosition) *typesens
|
|||||||
Labels: task.Labels,
|
Labels: task.Labels,
|
||||||
//RelatedTasks: task.RelatedTasks,
|
//RelatedTasks: task.RelatedTasks,
|
||||||
Attachments: task.Attachments,
|
Attachments: task.Attachments,
|
||||||
|
Positions: make(map[string]float64, len(positions)),
|
||||||
}
|
}
|
||||||
|
|
||||||
if task.DoneAt.IsZero() {
|
if task.DoneAt.IsZero() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user