Hi Everyone. Needed some help!
So I have around 30,000 records in my collection with fields like these
title: string;
regions_covered: string[];
countries_covered: string[];
companies: string[];
snippet: string (a very large text)
This is the problem I am encountering.
When I search for "South Africa" the top results I get only contain "Africa" in the title, with "South Africa" records coming at the end.
I have thousands of records with "South Africa" in the title and in countries_covered. But there are definitely even more records with only "Africa" in the title and regions covered or in snippets (containing the string "Africa" lots of times in them).
I have added weights to my query, but it's not working well.
Below is the JavaScript base query I am using for searching.
baseQuery = {
collection: "reports",
q: "",
query_by: "title,regions_covered,countries_covered,companies,snippet",
query_by_weights: "4,2,2,1,1",
page: 1,
per_page: 20,
facet_by: "report_publish_to",
filter_by: "active:=true && report_publish:=true",
include_fields: "report_id, report_publish_to",
}