solrsolrj

SolR PreserverMulti only for specific field


I'm using SolR for searching documents provided with numbers of metadata. (in average, more than 2 Mb per document) I'm focused on optimizing data amount to transfer, due to performance issue.

On query parameters, I'm using

  1. fl: to specifiy a few fields that I always need
  2. hl.fl for also this main fields, but also for additional fields on which I want data only if they contain requested text.

To preserve integrity and merge highlighted data with returned documents, I use hl.preserveMulti. (the only way I've found to merge which highlighted value to linked to raw original value)

I'm wondering if I can specify hl.preserveMulti=true only for main fields, and set it to false on extra fields.

I have not found anything in documentation about highlighting on this.

Any tips / advice ?


Solution

  • You can set field specific parameters by using the f.<fieldname>.<argument> syntax, so to set a specific hl parameter for just fieldname, use:

    f.fieldname.hl.preserveMulti=true