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


Java SolrOperations类代码示例

本文整理汇总了Java中org.springframework.data.solr.core.SolrOperations的典型用法代码示例。如果您正苦于以下问题:Java SolrOperations类的具体用法?Java SolrOperations怎么用?Java SolrOperations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SolrOperations类属于org.springframework.data.solr.core包,在下文中一共展示了SolrOperations类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTargetRepository

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected Object getTargetRepository(RepositoryMetadata metadata) {

	SolrOperations operations = this.solrOperations;
	if (factory != null) {
		SolrTemplate template = new SolrTemplate(factory);
		template.setSolrCore(SolrServerUtils.resolveSolrCoreName(metadata.getDomainType()));
		addSchemaCreationFeaturesIfEnabled(template);
		template.afterPropertiesSet();
		operations = template;
	}

	SimpleSolrRepository repository = new SimpleSolrRepository(getEntityInformation(metadata.getDomainType()),
			operations);
	repository.setEntityClass(metadata.getDomainType());

	this.templateHolder.add(metadata.getDomainType(), operations);
	return repository;
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:21,代码来源:SolrRepositoryFactory.java

示例2: resolveQuery

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, NamedQueries namedQueries) {

	SolrQueryMethod queryMethod = new SolrQueryMethod(method, metadata, entityInformationCreator);
	String namedQueryName = queryMethod.getNamedQueryName();

	SolrOperations solrOperations = selectSolrOperations(metadata);

	if (namedQueries.hasQuery(namedQueryName)) {
		String namedQuery = namedQueries.getQuery(namedQueryName);
		return new StringBasedSolrQuery(namedQuery, queryMethod, solrOperations);
	} else if (queryMethod.hasAnnotatedQuery()) {
		return new StringBasedSolrQuery(queryMethod, solrOperations);
	} else {
		return new PartTreeSolrQuery(queryMethod, solrOperations);
	}
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:18,代码来源:SolrRepositoryFactory.java

示例3: AbstractSolrQuery

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
/**
 * @param solrOperations must not be null
 * @param solrQueryMethod must not be null
 */
protected AbstractSolrQuery(SolrOperations solrOperations, SolrQueryMethod solrQueryMethod) {
	Assert.notNull(solrOperations);
	Assert.notNull(solrQueryMethod);
	this.solrOperations = solrOperations;
	this.solrQueryMethod = solrQueryMethod;
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:11,代码来源:AbstractSolrQuery.java

示例4: SolrUI

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Autowired
public SolrUI(SolrOperations solrOperations, PostDocService postDocService, SolrSettings solrSettings, PostService postService) {
    this.solrOperations = solrOperations;
    this.postDocService = postDocService;
    this.solrSettings = solrSettings;
    this.postService = postService;
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:8,代码来源:SolrUI.java

示例5: SolrRepositoryFactory

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
public SolrRepositoryFactory(SolrOperations solrOperations) {
	Assert.notNull(solrOperations);

	if (solrOperations instanceof SolrTemplate) {
		addSchemaCreationFeaturesIfEnabled((SolrTemplate) solrOperations);
	}

	this.solrOperations = solrOperations;
	this.entityInformationCreator = new SolrEntityInformationCreatorImpl(solrOperations.getConverter()
			.getMappingContext());
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:12,代码来源:SolrRepositoryFactory.java

示例6: selectSolrOperations

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
private SolrOperations selectSolrOperations(RepositoryMetadata metadata) {
	SolrOperations ops = templateHolder.getSolrOperations(metadata.getDomainType());
	if (ops == null) {
		ops = solrOperations;
	}
	return ops;
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:8,代码来源:SolrRepositoryFactory.java

示例7: SimpleSolrRepository

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
/**
 * @param metadata must not be null
 * @param solrOperations must not be null
 */
public SimpleSolrRepository(SolrEntityInformation<T, ?> metadata, SolrOperations solrOperations) {
	this(solrOperations);
	Assert.notNull(metadata);

	this.entityInformation = metadata;
	setIdFieldName(this.entityInformation.getIdAttribute());
	setEntityClass(this.entityInformation.getJavaType());
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:13,代码来源:SimpleSolrRepository.java

示例8: SolrRepositoryBean

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
public SolrRepositoryBean(Bean<SolrOperations> operations, Set<Annotation> qualifiers, Class<T> repositoryType,
		BeanManager beanManager) {
	super(qualifiers, repositoryType, beanManager);

	Assert.notNull(operations, "Cannot create repository with 'null' for SolrOperations.");
	this.solrOperationsBean = operations;
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:8,代码来源:SolrRepositoryBean.java

示例9: createRepositoryBean

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
private <T> Bean<T> createRepositoryBean(Class<T> repositoryType, Set<Annotation> qualifiers, BeanManager beanManager) {
	Bean<SolrOperations> solrOperationBeans = this.solrOperationsMap.get(qualifiers.toString());

	if (solrOperationBeans == null) {
		throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s.",
				SolrOperations.class.getName(), qualifiers));
	}

	return new SolrRepositoryBean<T>(solrOperationBeans, qualifiers, repositoryType, beanManager);
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:11,代码来源:SolrRepositoryExtension.java

示例10: createSolrTemplate

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Produces
public SolrOperations createSolrTemplate() throws IOException, ParserConfigurationException, SAXException {

	EmbeddedSolrServerFactory factory = new EmbeddedSolrServerFactory(ResourceUtils.getURL(
			"classpath:org/springframework/data/solr").getPath());

	SolrTemplate template = new SolrTemplate(factory);
	template.afterPropertiesSet();
	return template;
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:11,代码来源:SolrTemplateProducer.java

示例11: PostDocServiceImpl

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Autowired
public PostDocServiceImpl(SolrOperations solrOperations, PostService postService, ApplicationSettings applicationSettings) {
    this.solrOperations = solrOperations;
    this.postService = postService;
    this.applicationSettings = applicationSettings;
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:7,代码来源:PostDocServiceImpl.java

示例12: solrTemplate

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Bean
public SolrOperations solrTemplate(SolrClient server) throws Exception {
    return new SolrTemplate(server);
}
 
开发者ID:sburroughs,项目名称:Film-Suggestion,代码行数:5,代码来源:SolrRepositoryConfig.java

示例13: solrTemplate

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Bean
public SolrOperations solrTemplate() {
	return new SolrTemplate(solrServer());
}
 
开发者ID:guneriu,项目名称:rich-document-catalog,代码行数:5,代码来源:SearchContext.java

示例14: PartTreeSolrQuery

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
public PartTreeSolrQuery(SolrQueryMethod method, SolrOperations solrOperations) {
	super(solrOperations, method);
	this.tree = new PartTree(method.getName(), method.getEntityInformation().getJavaType());
	this.mappingContext = solrOperations.getConverter().getMappingContext();
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:6,代码来源:PartTreeSolrQuery.java

示例15: StringBasedSolrQuery

import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
public StringBasedSolrQuery(SolrQueryMethod method, SolrOperations solrOperations) {
	this(method.getAnnotatedQuery(), method, solrOperations);
}
 
开发者ID:ramaava,项目名称:spring-data-solr,代码行数:4,代码来源:StringBasedSolrQuery.java


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