mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
fix: correctly searches bing messages
This commit is contained in:
parent
a46ec62532
commit
34bef48e84
4 changed files with 14 additions and 10 deletions
|
|
@ -15,7 +15,8 @@ router.get('/sync', async function (req, res) {
|
|||
|
||||
router.get('/', async function (req, res) {
|
||||
try {
|
||||
const user = req?.session?.user?.username;
|
||||
let user = req?.session?.user?.username;
|
||||
user = user ?? null;
|
||||
const { q } = req.query;
|
||||
const pageNumber = req.query.pageNumber || 1;
|
||||
const key = `${user || ''}${q}`;
|
||||
|
|
@ -50,8 +51,10 @@ router.get('/', async function (req, res) {
|
|||
};
|
||||
});
|
||||
const titles = (await Conversation.meiliSearch(q)).hits;
|
||||
console.log('message hits:', messages.length, 'convo hits:', titles.length);
|
||||
const sortedHits = reduceHits(messages, titles);
|
||||
// debugging:
|
||||
// console.log('user:', user, 'message hits:', messages.length, 'convo hits:', titles.length);
|
||||
// console.log('sorted hits:', sortedHits.length);
|
||||
const result = await getConvosQueried(user, sortedHits, pageNumber);
|
||||
|
||||
const activeMessages = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue