feat: specify portions of document to be passed from platform to provider - #960
feat: specify portions of document to be passed from platform to provider#960madbob wants to merge 1 commit into
Conversation
| /** | ||
| * @param BodyPortion $query | ||
| * | ||
| * @return ISearchRequest | ||
| */ |
There was a problem hiding this comment.
| /** | |
| * @param BodyPortion $query | |
| * | |
| * @return ISearchRequest | |
| */ |
There was a problem hiding this comment.
Why to completely remove this comment? It is not useful, just as all other doc comment in this class...
|
|
||
| namespace OCA\FullTextSearch\Tools\Enums; | ||
|
|
||
| enum BodyPortion: string |
There was a problem hiding this comment.
I feel like this belong to https://github.com/nextcloud/server/tree/master/lib/public/FullTextSearch/Model and the addPortion and getPortions in the ISearchRequest interface also in server
…ider Signed-off-by: Roberto Guido <info@madbob.org>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Right now, FTS platform
fulltextsearch_elasticsearchreturns an arbitrary set of data among those stored in the index, ignoring tags, subtags, metatags and more (pun intended).It is fine to no fetch and pass everything all the time, but sometime a provider may find convenient to just reuse data already attached to a document instead of retrieve all of them from scratch.
Use case: I'm hacking a FTS provider for mail, and I have lots of structured data to index, to filter in search requests (e.g.
from:filters), and to use while displaying the response (e.g.fromcan be used to retrieve the avatar of the message sender). Retrieve all of them again from the database (or, even worse: from the IMAP server) for each search result may become a bit inefficient.Rationale of this proposal is to provide a method for the provider to specify (eventually in own implementation of
IFullTextSearchProvider::improveSearchRequest()) the list of parts required back from the platform. A mere list of strings inSearchRequest, meant to be read and handled from the platform.Sample implied implementation of changes in
SearchMappingService::generateSearchQueryParams()(here):and
SearchService::parseSearchEntry()also would require some adjustment (which I can provide myself if this is approved!).