@orama/orama
Advanced tools
Comparing version
@@ -99,3 +99,3 @@ import { prioritizeTokenScores } from '../components/algorithms.js'; | ||
const tokensLength = tokens.length; | ||
if (tokensLength) { | ||
if (tokensLength || properties && properties.length > 0) { | ||
// Now it's time to loop over all the indices and get the documents IDs for every single term | ||
@@ -106,8 +106,13 @@ const indexesLength = propertiesToSearch.length; | ||
const prop = propertiesToSearch[i]; | ||
const tokensLength = tokens.length; | ||
for(let j = 0; j < tokensLength; j++){ | ||
const term = tokens[j]; | ||
// Lookup | ||
const scoreList = await orama.index.search(context, index, prop, term); | ||
safeArrayPush(context.indexMap[prop][term], scoreList); | ||
if (tokensLength !== 0) { | ||
for(let j = 0; j < tokensLength; j++){ | ||
const term = tokens[j]; | ||
// Lookup | ||
const scoreList = await orama.index.search(context, index, prop, term); | ||
safeArrayPush(context.indexMap[prop][term], scoreList); | ||
} | ||
} else { | ||
context.indexMap[prop][''] = []; | ||
const scoreList = await orama.index.search(context, index, prop, ''); | ||
safeArrayPush(context.indexMap[prop][''], scoreList); | ||
} | ||
@@ -114,0 +119,0 @@ const docIds = context.indexMap[prop]; |
{ | ||
"name": "@orama/orama", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"type": "module", | ||
@@ -91,4 +91,4 @@ "description": "Next generation full-text and vector search engine, written in TypeScript", | ||
"vite": "^4.1.4", | ||
"@orama/stemmers": "1.2.7", | ||
"@orama/stopwords": "1.2.7" | ||
"@orama/stemmers": "1.2.8", | ||
"@orama/stopwords": "1.2.8" | ||
}, | ||
@@ -95,0 +95,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
553420
0.14%5735
0.09%