mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Use full text search instead of ilike for search functionality
This commit is contained in:
@@ -10,7 +10,7 @@ export const load: PageServerLoad = async ({ fetch, cookies, url }) => {
|
||||
const baseFetchUrl = `${API_BASE_PREFIX}/website`;
|
||||
|
||||
if (searchQuery) {
|
||||
params.append("title", `ilike.*${searchQuery}*`);
|
||||
params.append("title_search", `wfts(english).${searchQuery}`);
|
||||
}
|
||||
|
||||
switch (sortBy) {
|
||||
|
||||
@@ -10,7 +10,7 @@ export const load: PageServerLoad = async ({ params, fetch, cookies, url, parent
|
||||
const baseFetchUrl = `${API_BASE_PREFIX}/article?website_id=eq.${params.websiteId}&select=id,title`;
|
||||
|
||||
if (searchQuery) {
|
||||
parameters.append("title", `ilike.*${searchQuery}*`);
|
||||
parameters.append("title_description_search", `wfts(english).${searchQuery}`);
|
||||
}
|
||||
|
||||
switch (sortBy) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export const load: PageServerLoad = async ({ parent, params, cookies, fetch }) =
|
||||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
default: async ({ fetch, cookies, request, params, locals }) => {
|
||||
default: async ({ fetch, cookies, request, params }) => {
|
||||
const data = await request.formData();
|
||||
const coverFile = data.get("cover-image") as File;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user