Slackbot
09/26/2023, 4:00 AMNarayan Acharya
09/26/2023, 4:00 AMclient.collections.create({
"name": "Company",
"enable_nested_fields": True,
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "market_value",
"optional": True,
"index": False,
"type": "int64"
}
]
})
docs = [
{
"id": "789",
"market_value": 1000,
},{
"id": "777",
},
{
"id": "999",
"market_value": 400,
},
{
"id": "111",
"market_value": 50,
},
{
"id": "222",
"market_value": 5000,
}
]
client.collections['Company'].documents.import_(docs)
client.collections['Company'].documents.search({"q": "*", "sort_by": "market_value:desc"})Narayan Acharya
09/26/2023, 4:02 AMclient.collections['Company'].documents.search({"q": "*", "sort_by": "market_value(missing_values: last):desc"}) I get the same error:
typesense.exceptions.ObjectNotFound: [Errno 404] Could not find a field named `market_value` in the schema for sorting.Kishore Nallan
09/26/2023, 4:46 AMNarayan Acharya
09/26/2023, 4:51 AMKishore Nallan
09/26/2023, 4:52 AMKishore Nallan
09/26/2023, 4:52 AMNarayan Acharya
09/26/2023, 4:54 AM