this is the search params codes I have. ```const g...
# community-help
j
this is the search params codes I have.
Copy code
const getProductBySlug = async (sku: string): Promise<ITSProduct | null> => {
    let searchParameters = {
        q: '*',
        query_by: 'slug',
        filter_by: `slug:=[${sku}]`,
        sort_by: '_text_match:desc',
        facet_by: 'slug',
    };

    const results = await client
        .collections(TS_CONFIG.collectionNames.product)
        .documents()
        .search(searchParameters);

    let found = null;
    if (typeof results.hits !== 'undefined' && results.hits[0]) {
        const tsProductData: ITSProduct = JSON.parse(
            JSON.stringify(results.hits[0].document)
        );
        return tsProductData;
    }
    return found;
};