Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:58:06+00:00 2026-05-28T16:58:06+00:00

I’m trying to index data from a database in Solr using the DIH. So

  • 0

I’m trying to index data from a database in Solr using the DIH.

So I have modified the two config files as follows:

solrconfig.xml :

<requestHandler name="/dataimport" 
    class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
    <str name="config">data-config.xml</str>
</lst>
</requestHandler>

data-config.xml :

<dataConfig>
    <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/test" user="root" password="****"/>
    <document>
        <entity name="source_scellee" query="select * from source_scellee">
        </entity>
    </document>
</dataConfig>

source_scellee being the name of my table on my test database. It contains many fields.

Obviously, I’m trying to run nothing else than a simple test. When running http://localhost:8983/solr/dataimport?command=full-import&clean=false&commit=true I get the following result :

<str name="Full Dump Started">2012-01-27 12:27:01</str><str name="">Indexing completed. Added/Updated: 4 documents. Deleted 0 documents.</str><str name="Committed">2012-01-27 12:27:02</str>
<str name="**Total Documents Failed**">4</str>

Besides no warning nor error on the server logs. 4 is my number of records inside table “source_scellee”. But it says all documents fail.

If I run a query from http://localhost:8983/solr/admin/
no results appear, at all !! How can I solve it ?
(“:” shows no results)

Thank you for your help!!!

—-edit—
I have added these lines to my schema.xml :

<field name="ID" type="int" indexed="true" stored="true" />
    <field name="reference_catalogue"  type="string" indexed="true" stored="true"/>
    <field name="reference_capsule"  type="string" indexed="true" stored="true"/>
    <field name="organisme_certificateur"  type="string" indexed="true" stored="true" />
    <field name="reference_certificat"  type="string" indexed="true" stored="true" />
    <field name="duree_d_utilisation"  type="string" indexed="true" stored="true" />
    <field name="activite_nominale"   type="string" indexed="true" stored="true"/>
    <field name="activite_minimale"   type="string" indexed="true" stored="true"/>
    <field name="activite_maximale"   type="string" indexed="true" stored="true"/>
    <field name="coffret"  type="boolean" indexed="true" stored="true"/>
    <field name="dispositif_medical"  type="boolean" indexed="true" stored="true"/>
    <field name="forme_speciale" type="boolean" indexed="true" stored="true" />
    <field name="exemption_cpa"  type="boolean" indexed="true" stored="true"/>
    <field name="marquage_ce"  type="boolean" indexed="true" stored="true"/>
    <field name="element_cible"  type="boolean" indexed="true" stored="true"/>

However the result is still the same: no results when querying (I tried to restart solr, and to re-index all also)

——second edit—
I have tried the dynamic import
Now my data-config.xml looks like this :

<document>
       <entity name="source_scellee" query="select * from source_scellee">
            <field column="ID" name="ID_i" />
            <field column="reference_catalogue" name="reference_catalogue_s" />
            <field column="reference_capsule" name="reference_capsule_s" />
            <field column="organisme_certificateur" name="organisme_certificateur_s" />
            <field column="reference_certificat" name="reference_certificat_s" />
            <field column="duree_d_utilisation" name="duree_d_utilisation_s" />
            <field column="activite_nominale" name="activite_nominale_s" />
            <field column="activite_minimale" name="activite_minimale_s" />
            <field column="activite_maximale" name="activite_maximale_s" />
            <field column="coffret" name="coffret_b" />
            <field column="dispositif_medical" name="dispositif_medical_b" />
            <field column="forme_speciale" name="forme_speciale_b" />
            <field column="exemption_cpa" name="exemption_cpa_b" />
            <field column="marquage_ce" name="marquage_ce_b" />
            <field column="element_cible" name="element_cible_b" />
        </entity>
    </document>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:58:07+00:00Added an answer on May 28, 2026 at 4:58 pm

    1.) You can take a look to the statistics page to see, how much docs are indexed right now:
    http://localhost:8983/solr/admin/stats.jsp

    2.) The result of your search depends on your schema.xml, because there it’s defined how docs are indexed/stored, which fields are processed and how searchs are handled on query time.
    Please take a look at this file or post the field definition from the schema.xml and also the schema/design from your table source_scellee.
    Does the columns and the fields have the same name?

    //Edit: This should work, if coulmname and filedname are the same:

    <document>
           <entity name="source_scellee" 
                   pk="ID"
                   query="select * from source_scellee">
    
            </entity>
        </document>
    

    is having NULL values in data an issue ?

    that depends on the destination field.

    Are your running solr in an tomcat or someting like that?
    Take a look in the Java EE Container output, like catalina.out or so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.