: >>> This looks like a hack. It currently only uses highlighter for : >>> prefetching docs and fields . There is no standard way of other : >>> components to take part in this.
It was an optimization that improved the common when it was added, but it predates all of the search component stuff, so that's not much of a suprise that it's not easy for components to use. : Or we can add a method to ResponseBuilder.addPrefetchFields(String[] : fieldNames) and SearchComponents can use this in prepare()/process() : to express interest in prefetching. I would suggest using something like a FieldSelector instead of a String[], so that components wanting all files that match a rule don't have to manifest a large array. I can't put my finger on it, but it feels like there is a larger issue here ... relating to SOLR-1298, and how/when a DocList might/should get manifested as DocumentList ... It would be fairly easy to modify optimizePreFetchDocs to check properties on the ResponseBuilder (via the SolrQueryRequest) to decide which fields to ask for, but ultimately all optimizePreFetchDocs does is ask the SolrIndexSearche to load the doc and then throws it away (relying on the documentCache to have those fields handy for later use). as long as we're changing that, we might as well make it do ... something ... better. -Hoss