本文整理汇总了Java中org.apache.solr.client.solrj.beans.DocumentObjectBinder类的典型用法代码示例。如果您正苦于以下问题:Java DocumentObjectBinder类的具体用法?Java DocumentObjectBinder怎么用?Java DocumentObjectBinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentObjectBinder类属于org.apache.solr.client.solrj.beans包,在下文中一共展示了DocumentObjectBinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBeans
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
/**
* Adds a collection of beans specifying max time before they become committed
* @param beans the collection of beans
* @param commitWithinMs max time (in ms) before a commit will happen
* @throws IOException If there is a low-level I/O error.
* @since solr 3.5
*/
public UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException {
DocumentObjectBinder binder = this.getBinder();
ArrayList<SolrInputDocument> docs = new ArrayList<>(beans.size());
for (Object bean : beans) {
docs.add(binder.toSolrInputDocument(bean));
}
return add(docs, commitWithinMs);
}
示例2: initializeConverters
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
private void initializeConverters() {
if (!canConvert(Update.class, SolrInputDocument.class)) {
getConversionService().addConverter(new SolrjConverters.UpdateToSolrInputDocumentConverter());
}
if (!canConvert(Object.class, SolrInputDocument.class)) {
getConversionService().addConverter(
new SolrjConverters.ObjectToSolrInputDocumentConverter(new DocumentObjectBinder()));
}
}
示例3: addBeans
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
/**
* Adds a collection of beans specifying max time before they become committed
* @param beans the collection of beans
* @param commitWithinMs max time (in ms) before a commit will happen
* @throws IOException If there is a low-level I/O error.
* @since solr 3.5
*/
public UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException {
DocumentObjectBinder binder = this.getBinder();
ArrayList<SolrInputDocument> docs = new ArrayList<SolrInputDocument>(beans.size());
for (Object bean : beans) {
docs.add(binder.toSolrInputDocument(bean));
}
return add(docs, commitWithinMs);
}
示例4: construct
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Test
public void construct() {
SolrServer server = new TestSolrServer();
DocumentObjectBinder binder = new DocumentObjectBinder();
new DocumentBinderInjector(server, binder);
assertSame(binder, server.getBinder());
}
示例5: inject
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Test
public void inject() {
SolrServer server = new TestSolrServer();
DocumentObjectBinder binder = new DocumentObjectBinder();
DocumentBinderInjector.inject(server, binder);
assertSame(binder, server.getBinder());
}
示例6: injectWithAlreadyInitializedBinder
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Test
public void injectWithAlreadyInitializedBinder() {
SolrServer server = new TestSolrServer();
server.getBinder();
DocumentObjectBinder binder = new DocumentObjectBinder();
DocumentBinderInjector.inject(server, binder);
assertSame(binder, server.getBinder());
}
示例7: getBeans
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public <T> List<T> getBeans(Class<T> type){
return solrClient == null ?
new DocumentObjectBinder().getBeans(type,_results):
solrClient.getBinder().getBeans(type, _results);
}
示例8: getBeans
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public <T> List<T> getBeans(Class<T> type){
return solrServer == null ?
new DocumentObjectBinder().getBeans(type,_results):
solrServer.getBinder().getBeans(type, _results);
}
示例9: DocumentBinderConverter
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public DocumentBinderConverter(DocumentObjectBinder binder) {
this.documentObjectBinder = binder != null ? binder : new DocumentObjectBinder();
}
示例10: ObjectToSolrInputDocumentConverter
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public ObjectToSolrInputDocumentConverter(DocumentObjectBinder binder) {
super(binder);
}
示例11: SolrInputDocumentToObjectConverter
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public SolrInputDocumentToObjectConverter(Class<T> clazz, DocumentObjectBinder binder) {
super(binder);
this.clazz = clazz;
}
示例12: getBinder
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Override
public DocumentObjectBinder getBinder() {
throw new RuntimeException("Not Implemented.");
}
示例13: injectWithNullServer
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Test(expected = NullPointerException.class)
public void injectWithNullServer() {
SolrServer server = null;
DocumentObjectBinder binder = new DocumentObjectBinder();
DocumentBinderInjector.inject(server, binder);
}
示例14: injectWithNullBinder
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Test(expected = NullPointerException.class)
public void injectWithNullBinder() {
SolrServer server = new TestSolrServer();
DocumentObjectBinder binder = null;
DocumentBinderInjector.inject(server, binder);
}
示例15: DocumentBinderInjector
import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
/**
* Constructor that calls {@link #inject(SolrServer, DocumentObjectBinder)} on
* creation. This is a convenience constructor to provide yet another
* (easier?) way to configure as a Spring bean.
*
* @param server
* The server to be altered. Cannot be null.
* @param binder
* The binder to be set. Cannot be null.
* @throws IllegalArgumentException
* if server or binder are null.
* @throws UnsupportedOperationException
* if unable to find, access or set the field.
*/
public DocumentBinderInjector(SolrServer server, DocumentObjectBinder binder) {
inject(server, binder);
}