Re: Best way to return ExternalFileField in the results

2008-07-28 Thread Chris Hostetter

: I've been trying to return a field of type ExternalFileField in the search
: result. Upon examining XMLWriter class, it seems like Solr can't do this out
: of the box. Therefore, I've tried to hack Solr to enable  this behaviour.
: The goal is to call to ExternalFileField.getValueSource(SchemaField
: field,QParser parser) in XMLWriter.writeDoc(String name, Document
: document,...) method. There are two issues with doing this:

Some of what you're specificly asking about could probably be achieved by 
modifying the XMLWriter constructor to hang on to the SolrCore associated 
with the request.

In general though i wondering if steping back a bit and modifying your 
request handler to use a SolrDocumentList where you've already flattened 
the ExternalFileField into each SolrDocument would be an easier approach 
-- then you wouldnt' need to modify the ResponseWriter at all.




-Hoss



Re: Best way to return ExternalFileField in the results

2008-07-28 Thread Ryan McKinley


In general though i wondering if steping back a bit and modifying your
request handler to use a SolrDocumentList where you've already  
flattened
the ExternalFileField into each SolrDocument would be an easier  
approach

-- then you wouldnt' need to modify the ResponseWriter at all.




Consider using a search component at the end of the chain that adds  
fields to your document...  this way things work for any writer (json,  
xml, whatever)


We really should add an example to do this... but in the meantime, a  
good example (though a bit complex) is with the local lucene:

http://sourceforge.net/projects/locallucene/

this adds a calculated distance to each document before it gets passed  
to the writer