Open Leo310 opened 9 months ago
Hi, would you be able to provide a repro via replit/similar tool?
@micheleriva Here is the repro: https://replit.com/join/xnweszxeca-leodev310 I figured out that the filter doesn't match the exact entries of sources but on substrings of one entry.
I think in my previous example, "README.md" was a hit because it contained the ".md" substring. That's why every record was matching. Not sure if this is the intended behavior. If it is, is there another way to filter on exact matches?
The numeric filter also doesn't seem to work as expected: For this code:
const before = 1705758397008;
console.log('Searching for entries indexed before', before, 'in Oramadb', db.data.docs);
const results = await search(await this.db, { where: { indexed_at: { lt: before } }, 100 });
console.log('Results', results);
I get this output: where you can see that the indexed_at values of entries 21 and 22 are smaller than the value of before (1705757860535 < 1705758397008). But I also get no hits even though I am using the "lt" filter on indexed_at.
@Leo310 did you find a solution to this? I am facing the same problem
@AND-TomHarris Unfortunately not, I ended up using Dexie.js instead of Orama
+1, trying to filter for strings with spaces (e.g. "History and geography") gives back hits with substrings matching the query (e.g. every entry containing "and" in the filtered field).
Is there any workaround?
Uf. This is pretty bad.
Hi all!
Have you tried enum
instead of string
?
Internally, Orama uses a tokenizer for strings and indexes the tokenized strings. Instead, enum
values are treated as they are without manipulations.
Let me know.
Describe the bug
When I execute this code:
I get the following console output:
As you can see the first hit in the results already has a different source attribute (value: "README.md") than the filter (value: "To Add.md"). The filter was completely ignored.
To Reproduce
const db = await create({ schema: recordManagerSchema, id: "testdb", components: { tokenizer: { stemming: true, stemmerSkipProperties: ['id', 'source'], }, }, });
Affected areas
Search
Additional context
No response