smileBeda
11/08/2024, 9:16 AMTypesenseInstantSearchAdapter
, and it has been a while since I set this up
I notice my code:
function renderSearch(searchType) {
if (search) {
search.dispose();
}
let queryBy;
if (searchType === 'semantic') {
queryBy = 'embedding';
} else if (searchType === 'keyword') {
queryBy = 'Field1,Field2,Field3,Field4';
} else {
queryBy = 'Field1,Field2,Field3,Field4,embedding';
}
const typesenseInstantsearchAdapter =
new TypesenseInstantSearchAdapter({
server: TYPESENSE_SERVER_CONFIG,
additionalSearchParameters: {
query_by: queryBy,
exclude_fields:
'embedding,Field1,Field2,Field3,Field4',
prefix: false,
},
});
const searchClient = typesenseInstantsearchAdapter.searchClient;
...
...
I am not sure anymore why I did exclude_fields
at all.
Miracoulously the search works, but when I read this code, I am confused why it does 🤣
As I understand it I effectively tell it to search by fields I then explicitly exclude later 🤔Kishore Nallan
11/08/2024, 9:18 AMsmileBeda
11/08/2024, 9:19 AMhit
?Kishore Nallan
11/08/2024, 9:21 AM