Ya, I like this idea.

Adding a "meta" field is OK, but it may just be kicking the can. Also implementation wise, it works well when you have a SolrDocument, but when directly using DocList, it gets a bit messy.
https://issues.apache.org/jira/browse/SOLR-705

Also with adding a "meta" field, I'm not sure I like that it is a double object like:
 doc.get( "_meta_" ).get( "distance")

It would be nicer if the user does not have any idea if it is a pseudo- field or "real" field. (by "user" I mean how you consume the response, not how you construct the URL)

The SQL "as" command comes to mind:
 SELECT name, count(xxx) as cnt

ryan



On Aug 17, 2009, at 6:00 PM, Grant Ingersoll wrote:

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

Reply via email to