I have a schema that contains a fairly large text field.
I’ve gzipped it and enabled lazy loading, but it will still be fetched unless every client using solr explicitly sets the field list (fl) parameter.
How can I configure solr to omit the large gzipped text field from the results when querying without a field list parameter?
The simplest way to do this is to add the field list to the requestHandler. Assuming that you are using the default
/selectrequest handler, you will need to modify your solrconfig.xml adding thefloption to the list of defaults for the/selectrequestHandler. See below for an example.So in this example, I am setting the
flparameter so the query will return field1, field2 and field3 by default. These will be the fields returned when querying unless the request specifies the fl parameter and then whatever fields are sent will be returned.These defaults can be set per requestHandler, so if you are using an different requestHandler, then just modify your configuration as needed.
Hope this helps.