WeaviateEx.Query.Sort (WeaviateEx v0.7.4)
View SourceSort builder for Weaviate queries.
Provides a fluent API for building sort criteria.
Examples
# Single sort
Sort.by_property("title")
# Multiple sorts (chained)
Sort.by_property("category")
|> Sort.then_by_property("title", :desc)
# Sort by timestamps
Sort.by_creation_time(:desc)
Summary
Functions
Create a sort by creation timestamp.
Create a sort by object ID.
Create a sort by property name.
Create a sort by last update timestamp.
Add a secondary sort by creation time.
Add a secondary sort by ID.
Add a secondary sort by property.
Add a secondary sort by update time.
Convert sort criteria to GraphQL format.
Types
Functions
Create a sort by creation timestamp.
Examples
Sort.by_creation_time()
Sort.by_creation_time(:desc)
Create a sort by object ID.
Examples
Sort.by_id()
Sort.by_id(:desc)
Create a sort by property name.
Examples
Sort.by_property("title")
Sort.by_property("title", :desc)
Create a sort by last update timestamp.
Examples
Sort.by_update_time()
Sort.by_update_time(:desc)
Add a secondary sort by creation time.
Examples
Sort.by_property("category")
|> Sort.then_by_creation_time(:desc)
Add a secondary sort by ID.
Add a secondary sort by property.
Examples
Sort.by_property("category")
|> Sort.then_by_property("title", :desc)
Add a secondary sort by update time.
Convert sort criteria to GraphQL format.
Examples
Sort.by_property("title", :desc)
|> Sort.to_graphql()
# => "[{path: ["title"], order: desc}]"