[
https://issues.apache.org/jira/browse/SOLR-5154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740665#comment-13740665
]
David Smiley commented on SOLR-5154:
------------------------------------
Is the description not clear? I've got client code that takes a SolrServer
that might either be EmbeddedSolrServer or some other variant. I'd like to
stream the docs if possible, so I use the StreamingResponseCallback feature.
Yet apparently that only works with EmbeddedSolrServer, which I think was a
major oversight in the API.
My work around now is:
{code:java}
QueryRequest queryRequest = ...
queryRequest.setStreamingResponseCallback( ... );
QueryResponse response = queryRequest.process(solrServer);
SolrDocumentList docList = response.getResults();
if (docList != null) {
log.debug("Not streaming docs from Solr (not supported)");
StreamingResponseCallback callback = tagRequest
.getStreamingResponseCallback();
callback.streamDocListInfo(docList.getNumFound(),
docList.getStart(), docList.getMaxScore());
for (SolrDocument solrDoc : docList) {
callback.streamSolrDocument(solrDoc);
}
}
{code}
> StreamingResponseCallback should be used by non-Embedded solr servers too
> -------------------------------------------------------------------------
>
> Key: SOLR-5154
> URL: https://issues.apache.org/jira/browse/SOLR-5154
> Project: Solr
> Issue Type: Improvement
> Components: clients - java
> Reporter: David Smiley
>
> Apparently if you use a StreamingResponseCallback, then it is only used by
> EmbeddedSolrServer. I'm so surprised to see this was overlooked. I'd like
> to write a client that can use this callback no matter wether the SolrServer
> instance it has was initialized embedded mode or remote'ed.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]