本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例12: solrTemplate
import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Bean
public SolrOperations solrTemplate(SolrClient server) throws Exception {
return new SolrTemplate(server);
}
示例13: solrTemplate
import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
@Bean
public SolrOperations solrTemplate() {
return new SolrTemplate(solrServer());
}
示例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();
}
示例15: StringBasedSolrQuery
import org.springframework.data.solr.core.SolrOperations; //导入依赖的package包/类
public StringBasedSolrQuery(SolrQueryMethod method, SolrOperations solrOperations) {
this(method.getAnnotatedQuery(), method, solrOperations);
}