I'm looking a little bit at https://issues.apache.org/jira/browse/SOLR-1298
and some of the other "pseudo-field" capabilities and am curious how
the various Response Writers are handling writing out the Docs. The
XMLWriter seems to have a very different approach from the others when
it comes to dealing with multi-valued fields (it sorts first, the
others don't.) Does anyone know the history here?
Also, I'm thinking about having a real simple interface that would
allow for, when materializing the Fields, to pass in something like a
DocumentModifier, which would basically get the document right before
it is to be returned (possibly inside the SolrIndexReader, but maybe
this even belongs at the Lucene level similar to the FieldSelector,
although it is likely too late for 2.9.) Through this DocModifier,
one could easily add fields, etc.
Part of what I think needs to be addressed here is that currently, in
order to add fields, for instance, LocalSolr does this, one needs to
iterate over the DocList (or SolrDocList) multiple times.
SolrPluginUtils.docListtoSolrDocList attempts to help, but it still
requires a double loop. The tricky part here is that one often needs
to have context when modifying the Document that the Response Writer's
simply do not have, so you end up writing a SearchComponent to do it
and thus iterating multiple times.
I know this is a bit stream of conscience, but thought I would get it
out there a little bit to see what others thought.
-Grant
- Response Writers and DocLists Grant Ingersoll
-