本文整理汇总了Java中org.apache.solr.response.XMLResponseWriter类的典型用法代码示例。如果您正苦于以下问题:Java XMLResponseWriter类的具体用法?Java XMLResponseWriter怎么用?Java XMLResponseWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLResponseWriter类属于org.apache.solr.response包,在下文中一共展示了XMLResponseWriter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLazy
import org.apache.solr.response.XMLResponseWriter; //导入依赖的package包/类
public void testLazy() {
QueryResponseWriter qrw = h.getCore().getQueryResponseWriter("useless");
assertTrue("Should be a lazy class", qrw instanceof SolrCore.LazyQueryResponseWriterWrapper);
qrw = h.getCore().getQueryResponseWriter("xml");
assertTrue("Should not be a lazy class", qrw instanceof XMLResponseWriter);
}
示例2: embeddedQueryToXmlInputStream
import org.apache.solr.response.XMLResponseWriter; //导入依赖的package包/类
public static InputStream embeddedQueryToXmlInputStream(SolrParams request, QueryResponse response) {
XMLResponseWriter xmlWriter = new XMLResponseWriter();
Writer w = new StringWriter();
SolrQueryResponse sResponse = new SolrQueryResponse();
sResponse.setAllValues(response.getResponse());
try {
xmlWriter.write(w, new LocalSolrQueryRequest(null, request), sResponse);
} catch (IOException e) {
throw new RuntimeException("Unable to convert Solr response into XML", e);
}
StringReader stringReader = new StringReader(w.toString());
ReaderInputStream readerInputStream = new ReaderInputStream(stringReader);
return readerInputStream;
}