fix: correctly searches bing messages

This commit is contained in:
Daniel Avila 2023-03-24 18:26:59 -04:00
parent a46ec62532
commit 34bef48e84
4 changed files with 14 additions and 10 deletions

View file

@ -1,6 +1,6 @@
const cleanUpPrimaryKeyValue = (value) => {
// For Bing convoId handling
return value.replace(/--/g, '-');
return value.replace(/--/g, '|');
};
function replaceSup(text) {

View file

@ -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;
}
}