I could import data through solr DIH.

During my database I've 4 tables:

threads: id, user_id, country_id

tags: id

thread_tag_map: thread_id, tag_id

countries: id

posts: id, thread_id

i would like each document in solr to contain:

thread_id
tag_id
country_id
post_id

for instance:

thread_id: 1
tag_id: 23
tag_id: 34
country_id: 43
post_id: 4
post_id: 23
post_id: 23

how must i map it?

i havent had the opportunity to configure data-config.xml with this. i've adopted the DIH tutorial with no success.

Here's my schema.xml:

<schema name="example" version="1.2">
  <types>
    <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="uuid" class="solr.UUIDField" indexed="true" />
    <fieldType name="text_rev" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
           maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>
 </types>


 <fields>
   <field name="id" type="uuid" indexed="true" stored="true" default="NEW"/>
   <field name="threads.title" type="text_rev" indexed="true" stored="true"/>
   <field name="posts.body" type="text_rev" indexed="true" stored="true"/>
   <dynamicField name="*id" type="int" indexed="false" stored="true"/>
 </fields>

<uniqueKey>id</uniqueKey>

 <defaultSearchField>posts.body</defaultSearchField>

 <solrQueryParser defaultOperator="OR"/>
</schema>

It appears like you want to define these fields:

thread_id

tag_id

country_id

publish_id

as indexed 'string' fields in schema.xml. publish_id ought to be multi-valued="true". Begin to see the default schema.xml files for formatting recommendations. Or...

http://wiki.apache.org/solr/SchemaXml

The only real tricky factor here's really querying the database, not setting up solr. Just write a JOIN query where one can get all the ID's you'll need and employ a solr client library for the language to construct an easy datastruction, eg (json-y):

[{"thread_id":"1",
  "tag_id":"14",
  "country_id":"2",
  "post_id":["5",
             "7",
             "18"
            ]
},...and more...]

Since Solr is not a RDBMS, you will need to fake your searches by either doing multiple queries or using subqueries. An alternative choice may be using Solr to retrieve your thread or publish having a full-text search, after which utilizing an ID after that to operate a MySQL query which will enable you to get anything else you'll need.