Skip to content

Commit

Permalink
Use pre-normalized sort_by in Typesense config (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Dec 6, 2024
1 parent 63b04bd commit ef586f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core-data/src/utils/Typesense.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TypesenseConfig = {
port: number,
protocol: string,
query_by: string,
default_sort?: string
sort_by: string
};

const ATTRIBUTE_DELIMITER = '.';
Expand Down Expand Up @@ -102,7 +102,7 @@ const createTypesenseAdapter = (config: TypesenseConfig, options = {}) => (
additionalSearchParameters: {
query_by: config.query_by,
limit: config.limit || 250,
sort_by: `_text_match:desc${config.default_sort ? `,${config.default_sort}:asc` : ''}`
sort_by: config.sort_by
},
...options
})
Expand Down

0 comments on commit ef586f2

Please sign in to comment.