mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
fix: correctly searches bing messages
This commit is contained in:
parent
a46ec62532
commit
34bef48e84
4 changed files with 14 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
const cleanUpPrimaryKeyValue = (value) => {
|
||||
// For Bing convoId handling
|
||||
return value.replace(/--/g, '-');
|
||||
return value.replace(/--/g, '|');
|
||||
};
|
||||
|
||||
function replaceSup(text) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const mergeSort = require('./mergeSort');
|
||||
const { cleanUpPrimaryKeyValue } = require('./misc');
|
||||
|
||||
function reduceMessages(hits) {
|
||||
const counts = {};
|
||||
|
@ -29,15 +30,16 @@ function reduceHits(hits, titles = []) {
|
|||
const convos = [...hits, ...titles];
|
||||
|
||||
for (const convo of convos) {
|
||||
if (!counts[convo.conversationId]) {
|
||||
counts[convo.conversationId] = 1;
|
||||
const currentId = cleanUpPrimaryKeyValue(convo.conversationId);
|
||||
if (!counts[currentId]) {
|
||||
counts[currentId] = 1;
|
||||
} else {
|
||||
counts[convo.conversationId]++;
|
||||
counts[currentId]++;
|
||||
}
|
||||
|
||||
if (convo.title) {
|
||||
// titleMap[convo.conversationId] = convo._formatted.title;
|
||||
titleMap[convo.conversationId] = convo.title;
|
||||
// titleMap[currentId] = convo._formatted.title;
|
||||
titleMap[currentId] = convo.title;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue