本文整理汇总了Java中org.apache.solr.client.solrj.StreamingResponseCallback类的典型用法代码示例。如果您正苦于以下问题:Java StreamingResponseCallback类的具体用法?Java StreamingResponseCallback怎么用?Java StreamingResponseCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamingResponseCallback类属于org.apache.solr.client.solrj包,在下文中一共展示了StreamingResponseCallback类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTagStreaming
import org.apache.solr.client.solrj.StreamingResponseCallback; //导入依赖的package包/类
@Test
public void testTagStreaming() throws IOException, SolrServerException {
ModifiableSolrParams params = params();
String input = "foo boston bar";//just one tag;
QueryRequest req = new SolrTaggerRequest(params, input);
req.setPath("/tag");
final AtomicReference<SolrDocument> refDoc = new AtomicReference<>();
req.setStreamingResponseCallback(new StreamingResponseCallback() {
@Override
public void streamSolrDocument(SolrDocument doc) {
refDoc.set(doc);
}
@Override
public void streamDocListInfo(long numFound, long start, Float maxScore) {
}
});
QueryResponse rsp = req.process(solrServer);
assertNotNull(rsp.getResponse().get("tags"));
assertNotNull(refDoc.get());
assertEquals("Boston", ((Field)refDoc.get().getFieldValue("name")).stringValue());
}
示例2: StreamingBinaryResponseParser
import org.apache.solr.client.solrj.StreamingResponseCallback; //导入依赖的package包/类
public StreamingBinaryResponseParser( StreamingResponseCallback cb )
{
this.callback = cb;
}
示例3: queryAndStreamResponse
import org.apache.solr.client.solrj.StreamingResponseCallback; //导入依赖的package包/类
@Override
public QueryResponse queryAndStreamResponse(SolrParams params, StreamingResponseCallback callback)
throws SolrServerException, IOException {
throw new RuntimeException("Not Implemented.");
}