Struggling to find method for converting a Document from the index into a SolrDocument suitable for inclusion in a SolrQueryResponse for solr-core-5.5.2.jar
solr-core-5.2.1.jar had an ResponseWriterUtil.toSolrDocument(Document doc, IndexSchema schema) which is removed from solr-core-5.3.0 version
Thanks in advance
The ResponseWriterUtil class has been replaced with DocsStreamer (
org.apache.solr.response.DocsStreamer).Depending on the API version, you either give it it's parameters from the ResultContext (for 5.5.2):
or in newer versions, you give it the resultcontext directly:
If you use the constructor you get an iterator over the doclist from the result context, and you can use
.next()to move to the next document as necessary.