Skip to content

feat: FullTextSearch request includes portion of data to be retrieved from indexer - #62903

Closed
madbob wants to merge 1 commit into
nextcloud:masterfrom
madbob:fts_portions
Closed

feat: FullTextSearch request includes portion of data to be retrieved from indexer#62903
madbob wants to merge 1 commit into
nextcloud:masterfrom
madbob:fts_portions

Conversation

@madbob

@madbob madbob commented Aug 4, 2026

Copy link
Copy Markdown

Follow-up nextcloud/fulltextsearch#960


Right now, FTS platform fulltextsearch_elasticsearch returns 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. from can 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 in SearchRequest, meant to be read and handled from the platform.

Sample implied implementation of changes in SearchMappingService::generateSearchQueryParams() (here):

$params = [
	'index' => $this->configService->getElasticIndex(),
	'size' => $request->getSize(),
	'from' => (($request->getPage() - 1) * $request->getSize()),
	'_source_excludes' => 'content',
	'_source_includes' => join(',', $request->getPortions()),   // <----- this line!
];

and SearchService::parseSearchEntry() also would require some adjustment (which I can provide myself if this is approved!).

@CarlSchwan CarlSchwan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread lib/public/FullTextSearch/Model/BodyPortion.php
Comment thread lib/public/FullTextSearch/Model/ISearchRequest.php Outdated
Comment thread lib/public/FullTextSearch/Model/BodyPortion.php
… from indexer

Signed-off-by: Roberto Guido <info@madbob.org>
@CarlSchwan CarlSchwan added 3. to review Waiting for reviews community pull requests from community labels Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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.)

@madbob

madbob commented Aug 20, 2026

Copy link
Copy Markdown
Author

I close this to merge proposed changes in ongoing discussion on nextcloud/fulltextsearch#973

@madbob madbob closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews community pull requests from community feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants