Closed fasenderos closed 1 month ago
Hi @fasenderos, thanks for the issue!
In Orama Cloud we have the returning
statement that works like this:
const searchResult = await search(db, {
term: 'headphones',
returning: [ 'name', 'description']
})
would that work? It wouldn't support exclusive projection though.
Hello @micheleriva , thanks for your reply.
Yes, the returning
statement is exactly what I'm looking for, and it's perfectly fine without the exclusive projection. Do you think it can be added to the search of @orama/orama
?
Yes it can definitely be added to @orama/orama
, but I fear it would slow down search... removing properties from objects is expensive. It's worth it when done server-side 'cause you save on payload size
removing properties from objects is expensive. It's worth it when done server-side 'cause you save on payload size
Totally agree, doing it client-side wouldn't make any sense and it should be highlighted in the documentation. If you want, I can open a PR
yes please!
Problem Description
While working with Orama server-side, I would like to be able to exclude certain fields from the search to reduce the amount of data transferred and improve efficiency
Proposed Solution
Similar to MongoDB, I was thinking of a new search option called
projection
that would be either inclusive (which excludes all other fields) or exclusive (which implies all other fields are included) e.g.:Inclusive projection
Exclusive projection
If you think it might be useful, I'll be happy to open a PR.
Alternatives
No response
Additional Context
No response