Hi Matto,

please see my answers inline.

On Mon, Oct 25, 2021 at 6:37 AM Matto Marjanovic <maddog@mir.com> wrote:
[...]
It would be a-ok if the 'more_file_text' could just be treated as additional
content for the 'file_text' field.  (However, simply populating the existing
'file_text' field via the SearchDataForIndexHook does not work, because the
FileContentHandler::getDataForSearchIndex() method runs after the hook and
always forcefully overwrites the 'file_text' field.)

This should be do-able by implementing the CirrusSearchBuildDocumentParse hook which runs very late in the process (see cirrus doc under docs/hooks.txt).
It could be only CirrusSearchBuildDocumentParse if you have the data at hand when this hook runs or a combination of SearchDataForIndexHook to populate a "more_file_text" field like you do + CirrusSearchBuildDocumentParse to append this "more_file_text" to the existing "file_text" and possibly empty the "more_file_text" field if you no longer need it.

There are probably more ways to achieve what you want with greater control of the ranking but this will probably be much more involved (i.e. writing your own search query builder).

--
David Causse