Indexing nested documents in Solr
Tag : solr , By : Stephen
Date : March 29 2020, 07:55 AM
I hope this helps you . There are a couple ways to go. A json string can be stored explicitly, with serialization handled in the application layer. Elasticsearch uses this approach transparently. For indexing, you can flatten the data using naming conventions. Mongodb uses such a syntax. companies.name: ['google', 'sherwin-williams']
companies.title: ['software engineer', 'web developer']
<BooleanQuery: +companies.name:google +companies:web developer>
|
How to create nested document in Solr indexing?
Tag : java , By : user179190
Date : March 29 2020, 07:55 AM
This might help you In our schema we've a lot of related tables. We decided to flatten all relations into one document. To achieve this we created a custom importer (using SolrJ), which loads each document from the index, adds the related fields and write that document back.
|
Solr: Indexing nested Documents via DIH
Date : March 29 2020, 07:55 AM
I wish did fix the issue. This feature has been implemented by SOLR-5147 and should be available for Solr 5.1+ Here is a sample configuration taken from the original Jira ticket. <dataConfig>
<dataSource type="JdbcDataSource" />
<document>
<entity name="PARENT" query="select * from PARENT">
<field column="id" />
<field column="desc" />
<field column="type_s" />
<entity child="true" name="CHILD" query="select * from CHILD where parent_id='${PARENT.id}'">
<field column="id" />
<field column="desc" />
<field column="type_s" />
</entity>
</entity>
</document>
</dataConfig>
|
How Indexing nested documents using spring solr data
Date : March 29 2020, 07:55 AM
around this issue Nested Document support has been recently added to Spring Data for Apache Solr. At the time of writing there are only snapshot builds for this feature available. Please see DATASOLR-394 and the documentation for details.
|
No Association Found Error while indexing data to Solr using Spring-Data-Solr
Date : March 29 2020, 07:55 AM
it helps some times I updated my SpringSolrConfig file as below to fix the problem. Courtesy: https://jira.spring.io/browse/DATASOLR-394 @Configuration
public class SpringSolrConfig extends AbstractSolrConfig {
String solrUrl = "http://localhost:8983/solr/"; // TODO read this ideally from spring-configuration.xml file
public SolrClientFactory solrClientFactory (){
SolrClient solrClient = new HttpSolrClient.Builder(solrUrl).build();
HttpSolrClientFactory solrClientFactory = new HttpSolrClientFactory (solrClient);
return solrClientFactory;
}
@Bean
public SolrTemplate solrTemplate () {
SolrTemplate solrTemplateObj = new SolrTemplate(solrClientFactory));
// This ensures that the default MappingSolrConverter.java is not used for converting the bean to a Solr Document before indexing
solrTemplateObj.setSolrConverter(new SolrJConverter());
return solrTemplateObj;
}
}
|