当前位置: 首页>>代码示例>>Java>>正文


Java DocumentObjectBinder类代码示例

本文整理汇总了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);
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:SolrServer.java

示例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()));
	}
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:10,代码来源:SolrJConverter.java

示例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);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:16,代码来源:SolrServer.java

示例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());
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:8,代码来源:DocumentBinderInjectorTest.java

示例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());
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:8,代码来源:DocumentBinderInjectorTest.java

示例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());
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:9,代码来源:DocumentBinderInjectorTest.java

示例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);
}
 
开发者ID:redlink-gmbh,项目名称:solrj-text-tagger,代码行数:6,代码来源:TagResponse.java

示例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);
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:QueryResponse.java

示例9: DocumentBinderConverter

import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public DocumentBinderConverter(DocumentObjectBinder binder) {
	this.documentObjectBinder = binder != null ? binder : new DocumentObjectBinder();
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:4,代码来源:SolrjConverters.java

示例10: ObjectToSolrInputDocumentConverter

import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public ObjectToSolrInputDocumentConverter(DocumentObjectBinder binder) {
	super(binder);
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:4,代码来源:SolrjConverters.java

示例11: SolrInputDocumentToObjectConverter

import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
public SolrInputDocumentToObjectConverter(Class<T> clazz, DocumentObjectBinder binder) {
	super(binder);
	this.clazz = clazz;
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:5,代码来源:SolrjConverters.java

示例12: getBinder

import org.apache.solr.client.solrj.beans.DocumentObjectBinder; //导入依赖的package包/类
@Override
public DocumentObjectBinder getBinder() {
  throw new RuntimeException("Not Implemented.");
}
 
开发者ID:apache,项目名称:incubator-blur,代码行数:5,代码来源:SolrLookingBlurServer.java

示例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);
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:7,代码来源:DocumentBinderInjectorTest.java

示例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);
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:7,代码来源:DocumentBinderInjectorTest.java

示例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);
}
 
开发者ID:enriquedacostacambio,项目名称:iotake-suller,代码行数:18,代码来源:DocumentBinderInjector.java


注:本文中的org.apache.solr.client.solrj.beans.DocumentObjectBinder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。