Skip to content

Commit

Permalink
Update search parameters in firebase functions
Browse files Browse the repository at this point in the history
  • Loading branch information
patelneel55 committed Jan 13, 2021
1 parent 3426d0e commit d98d0ca
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
14 changes: 14 additions & 0 deletions backend/functions/.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"memoree": {
"search_port": "1491",
"parsed_json_bucket": "parsed_json_archive",
"algolia_appid": "8GAF49D2GO",
"json_bucket": "video_json_archive",
"algolia_index": "videos",
"search_index": "videos",
"search_host": "35.222.10.51",
"algolia_admin_key": "c595799e733fb372fb8902d19c3ab389",
"search_apikey": "tls98Gaqf2Cc19l2j02V2Zj4fAgQoNoQH5IhDT9KUOR6jF8z",
"video_bucket": "memoree_video_archive"
}
}
10 changes: 5 additions & 5 deletions backend/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ async function makeSearchRequest(queryParams)
functions.config().memoree.search_apikey,
functions.config().memoree.search_index
);
if(searchResult.hits.length == 0)
if(searchResult.grouped_hits.length == 0)
break;

let results = searchResult.hits.map(obj => {
let results = searchResult.grouped_hits.map(obj => {
return {
"file_name": obj.document.file_name,
"confidence": obj.document.confidence,
"document": obj.document
"file_name": obj.hits[0].document.file_name,
"confidence": obj.hits[0].document.confidence,
"document": obj.hits[0].document
}
});

Expand Down
3 changes: 2 additions & 1 deletion backend/functions/typesense.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ exports.search = (queryParams, host, port, apiKey, targetIndex) => {
'query_by': 'entity,keywords,text,transcript,file_name',
'per_page': 250,
'group_by': 'file_name',
'group_limit': 1
'group_limit': 1,
'num_typos': 1,
}
if(queryParams.sortType != "relevant")
searchParameters["sort_by"] = queryParams.sortType
Expand Down
17 changes: 0 additions & 17 deletions frontend/memoree_client/lib/app/pages/videos.dart

This file was deleted.

0 comments on commit d98d0ca

Please sign in to comment.