logo
down
shadow

Indexing nested data with Solr


Indexing nested data with Solr

Content Index :

Indexing nested data with Solr
Tag : solr , By : silvervino
Date : January 12 2021, 08:33 AM

With these it helps this happens cause the fact of requiring a field is applied ALSO to parent docs. So your parent docs need to have those fields too, even if they just make sense for the children.
The same issue will show up with the 'id' field...Just remove the required attribute.
<entity name="employees"
        rootEntity="true"
        query="select emp_no as 'id', first_name, last_name, 'DUMMY' as dept_no from employees limit 10;">
    <field column="id" />

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

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


Tag : development , By : 40a
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


Tag : development , By : sep
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


Tag : solr , By : Erik
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;
    }

    }
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com