spring-data-solr

java.lang.IllegalArgumentException: Environment must not be null

别说谁变了你拦得住时间么 提交于 2019-12-04 23:26:23
问题 I try to setup a basic SolrRepository app and Have this error during ApplicationContext load : Caused by: java.lang.IllegalArgumentException: Environment must not be null! at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.data.repository.config.RepositoryConfigurationSourceSupport.<init>(RepositoryConfigurationSourceSupport.java:50) at org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.<init>

java.lang.IllegalArgumentException: Environment must not be null

被刻印的时光 ゝ 提交于 2019-12-04 08:09:05
I try to setup a basic SolrRepository app and Have this error during ApplicationContext load : Caused by: java.lang.IllegalArgumentException: Environment must not be null! at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.data.repository.config.RepositoryConfigurationSourceSupport.<init>(RepositoryConfigurationSourceSupport.java:50) at org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.<init>(AnnotationRepositoryConfigurationSource.java:74) at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport

How to configure Spring Data Solr with Repositories for multiple cores

时间秒杀一切 提交于 2019-12-04 06:34:13
问题 Is there a detailed and complete explanation for setting up spring data with solr using repositories with multicore support? 回答1: The only dependency that need to be used for spring-data-solr is <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-solr</artifactId> <version>1.5.2.RELEASE</version> </dependency> It downloads solrj dependency and this must not be overridden with later versions of solrj . Also It is always preferable to use HttpSolrServer over

Enable schemaCreationSupport in spring-boot-starter-data-solr

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 06:10:36
问题 I use spring-boot-starter-data-solr and would like to make use of the schmea cration support of Spring Data Solr, as stated in the documentation: Automatic schema population will inspect your domain types whenever the applications context is refreshed and populate new fields to your index based on the properties configuration. This requires solr to run in Schemaless Mode. However, I am not able to achieve this. As far as I can see, the Spring Boot starter does not enable the

How to configure Spring Data Solr with Repositories for multiple cores

二次信任 提交于 2019-12-02 12:13:20
Is there a detailed and complete explanation for setting up spring data with solr using repositories with multicore support? The only dependency that need to be used for spring-data-solr is <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-solr</artifactId> <version>1.5.2.RELEASE</version> </dependency> It downloads solrj dependency and this must not be overridden with later versions of solrj . Also It is always preferable to use HttpSolrServer over EmbeddedSolrServer which is what we will be working with. The Configuration class should look like this:

Enable schemaCreationSupport in spring-boot-starter-data-solr

落爺英雄遲暮 提交于 2019-12-02 08:09:41
I use spring-boot-starter-data-solr and would like to make use of the schmea cration support of Spring Data Solr, as stated in the documentation : Automatic schema population will inspect your domain types whenever the applications context is refreshed and populate new fields to your index based on the properties configuration. This requires solr to run in Schemaless Mode. However, I am not able to achieve this. As far as I can see, the Spring Boot starter does not enable the schemaCreationSupport flag on the @EnableSolrRepositories annotation. So what I tried is the following:

Implementing Tagging and Excluding Filters with Solrj / Spring Data Solr

纵饮孤独 提交于 2019-12-01 20:59:14
I am trying to implement a Solr Facet search with multi-select on a field. To take this example: http://docs.lucidworks.com/display/solr/Faceting#Faceting-LocalParametersforFaceting , I would like to generate this call to solr: q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype I am not sure how to call this using solrj (java) as I don't want to add a simple filed but I need to include the tagging and excluding (!tag=dt and !ex=dt). Any ideas what the java code should look like? I am using Spring-Data-Solr which seems to be too basic to make such an

How to Implement custom Solr Repository using Spring Data Solr for multiple cores and repositories

匆匆过客 提交于 2019-11-30 16:10:44
I want to have access to multiple/2 repos in one service using spring-data-solr. From Spring Data Solr multiple cores and repository I know 'multicore support via namespace config is unfortunately an open issue'. Can you please help me with the following example, how can I create custom Repos? My applicationContext.xml has two Solr Templates defined as below: <!-- Enable Solr repositories and configure repository base package --> <solr:repositories base-package="com.ay.api.repository"/> <!-- Configures HTTP Solr server --> <solr:solr-server id="solrServer" url="${solr.server.url}"/> <!--

How to return distance and score in spatial search using spring-data-solr

不羁岁月 提交于 2019-11-29 15:18:12
问题 I'm writing a Spring MVC based Search API using spring-data-solr 1.0.0.RELEASE with Solr 4.4.0 and Spring 3.2.4.RELEASE. I'm able to run basic queries but unable to find any good example how can I return score and distance:geodist() in the results. I know I can get results from Solr using query like http://localhost:8983/solr/events/select?q=*:*&spatial=true&pt=51.435872%2C-0.427529&sfield=position&d=20&facet=true&facet.mincount=1&facet.limit=-1&facet.field=categoryIds&fl=score,*,distance

Spring Data Solr multiple cores and repository

瘦欲@ 提交于 2019-11-27 04:39:45
问题 I have apache solr with multiple cores e.g. currency, country etc... So using Spring Data Solr I can retrieve information from one core. I have got this XML configuration right now queries against 'currency' core. If I wanted to query against 'country' core how can I set this up? <!-- Enable Solr repositories and configure repository base package --> <solr:repositories base-package="com.acme.repository" solr-template-ref="solrCurrencyTemplate"/> <solr:solr-server id="solrCurrencyServer" url=