Two problems:
1) You have <span> (span) elements in your solrconfig.xml. They just
do not belong there. The original tutorial screwed up. Your element
should be on the same level as the other elements in that example.
2) You also seem to have another random piece of data configuration in
the solrconfig.xml. Also in the spans, so they are being ignored. But
still very very wrong. Take those out all together.

You should just have 3 things tying together:
1) jars loaded in the lib statement in solrconfig.xml
2) handler definition that points at your data-config file
3) data-config file itself.

If you are still having troubles, I strongly recommend getting the
shipped example to work and then adding your own stuff until you get
that working. Then, try to create a standalone configuration.
Sometimes, this is an easier approach for the first time user.

Regards,
   Alex.
P.s. I also cover that in my Solr book. A relevant example is here:
https://github.com/arafalov/solr-indexing-book/tree/master/published/dihdb
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 3 November 2014 13:40, Tim Dunphy <bluethu...@gmail.com> wrote:
> Hi Alexandre,
>
>  Thanks so much for your input and examples! Ok so here's what I've done so
> far with no luck as of yet unfortunately.
>
>   Inside of solrconfig.xml I put the following:
>
>   <lib dir="/opt/solr/dist/" regex="solr-dataimporthandler-.*\.jar" />
>   <lib dir="/opt/solr/contrib/extraction/lib" regex=".*\.jar" />
>   <lib dir="/opt/solr/dist/" regex="solr-cell-\d.*\.jar" />
>
>   <lib dir="/opt/solr/contrib/clustering/lib/" regex=".*\.jar" />
>   <lib dir="/opt/solr/dist/" regex="solr-clustering-\d.*\.jar" />
>   <lib dir="/opt/solr/contrib/langid/lib/" regex=".*\.jar" />
>   <lib dir="/opt/solr/dist/" regex="solr-langid-\d.*\.jar" />
>
>   <lib dir="/opt/solr/contrib/velocity/lib" regex=".*\.jar" />
>   <lib dir="/opt/solr/dist/" regex="solr-velocity-\d.*\.jar" />
>
> As you can see, I've replaced the relative paths with absolute ones. So as
> of now, my solr 4 server is no longer complaining about not being able to
> find directories and modules. So we're off to a good start! And now I can
> list the 'dist' directory and in my case find the jar files I'm looking for.
>
>
> [root@solr1:/opt/solr/collection1/conf] #ls /opt/solr/dist/ | grep
> dataimporthandler
> solr-dataimporthandler-4.10.1.jar
> solr-dataimporthandler-extras-4.10.1.jar
>
> So far so good.
>
> I next tried this db-data-config file in the same directory as
> solrconfig.xml
>
> [root@solr1:/opt/solr/collection1/conf] #cat db-data-config.xml.bak
> <span>
>
> <dataConfig>
>
> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
> url="jdbc:mysql://web1.mydomain.com:3306/jokefire" user="admin"
> password="secret" batchSize="1" />
>     <document name="players">
>
>         <entity name="jokefire_users" query="SELECT * FROM wp_users">
>             <field column="ID" name="ID" />
>             <field column="user_login" name="user_login" />
>             <field column="user_nicename" name="user_nicename" />
>             <field column="user_email" name="user_email" />
>             <field column="user_url" name="user_url" />
>             <field column="user_registered" name="user_registered" />
>             <field column="user_activation_key" name="user_activation_key"
> />
>             <field column="user_status" name="user_status" />
>             <field column="display_name" name="display_name" />
>         </entity>
>
>     </document>
> </dataConfig>
> </span>
>
> Restarted tomcat, and with this setup I wasn't getting any errors in the
> browser or logs and the web interface was still working. Always a good sign!
>
> So then I went down to Core Selector -> collection1 -> data import. And it
> was quite frustrating, cuz I was getting the same error as before!
>
>  sorry, no dataimport-handler defined!
>
> So then I tried the exact db-data-config.xml file from your example.
>
> <dataConfig>
>     <dataSource driver="org.hsqldb.jdbcDriver"
> url="jdbc:hsqldb:./example-DIH/hsqldb/ex" user="sa" />
>     <document>
>         <entity name="item" query="select * from item"
>                 deltaQuery="select id from item where last_modified >
> '${dataimporter.last_index_time}'">
>             <field column="NAME" name="name" />
>
>             <entity name="feature"
>                     query="select DESCRIPTION from FEATURE where
> ITEM_ID='${item.ID}'"
>                     deltaQuery="select ITEM_ID from FEATURE where
> last_modified > '${dataimporter.last_index_time}'"
>                     parentDeltaQuery="select ID from item where
> ID=${feature.ITEM_ID}">
>                 <field name="features" column="DESCRIPTION" />
>             </entity>
>
>             <entity name="item_category"
>                     query="select CATEGORY_ID from item_category where
> ITEM_ID='${item.ID}'"
>                     deltaQuery="select ITEM_ID, CATEGORY_ID from
> item_category where last_modified > '${dataimporter.last_index_time}'"
>                     parentDeltaQuery="select ID from item where
> ID=${item_category.ITEM_ID}">
>                 <entity name="category"
>                         query="select DESCRIPTION from category where ID =
> '${item_category.CATEGORY_ID}'"
>                         deltaQuery="select ID from category where
> last_modified > '${dataimporter.last_index_time}'"
>                         parentDeltaQuery="select ITEM_ID, CATEGORY_ID from
> item_category where CATEGORY_ID=${category.ID}">
>                     <field column="DESCRIPTION" name="cat" />
>                 </entity>
>             </entity>
>         </entity>
>     </document>
> </dataConfig>
>
> Knowing full well it wouldn't actually work, as I"m using a remote mysql
> database instead of a local hsqldb database.But at this point, my only goal
> was to get the data import to show up as an option. I'd tweak the
> db-data-config.xml file at a later point if this in fact worked!
>
> But alas, I was still getting the same result...
>
> sorry, no dataimport-handler defined!
>
> Grrrr.. so annoying after all that work. Anyway, I really do appreciate your
> kindness and help. :) I'm enclosing my solrconfig.xml and both versions of
> my db-data-config.xml in hopes that we can make some progress here!
>
>
> Thank
>
>
> Tim
>
>
>
>
>
>
>
>
>
> On Sun, Nov 2, 2014 at 9:50 PM, Alexandre Rafalovitch <arafa...@gmail.com>
> wrote:
>>
>> That tutorial seems to be somewhat dodgy. You need at least one more
>> step of adding DIH library in solrconfig.xml:
>>
>> https://github.com/apache/lucene-solr/blob/lucene_solr_4_10_2/solr/example/example-DIH/solr/db/conf/solrconfig.xml#L75
>> (I recommend using absolute path though).
>>
>> Also, you should not need to spell the full class out. See lower down
>> in the same class:
>>
>> https://github.com/apache/lucene-solr/blob/lucene_solr_4_10_2/solr/example/example-DIH/solr/db/conf/solrconfig.xml#L823
>>
>> Finally, in the config file, I don't remember document element having
>> a name. Again, the working example can be found in the same directory:
>>
>> https://github.com/apache/lucene-solr/blob/lucene_solr_4_10_2/solr/example/example-DIH/solr/db/conf/db-data-config.xml#L3
>>
>> Solr ships with a bunch of examples. If you are using/download
>> standard distribution, you could start from those until you understand
>> how it all hangs together.
>>
>> Regards,
>>    Alex.
>>
>> Personal: http://www.outerthoughts.com/ and @arafalov
>> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
>> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>>
>>
>> On 2 November 2014 21:26, Tim Dunphy <bluethu...@gmail.com> wrote:
>> > Hi Alex,
>> >
>> >
>> >> I thought the "<span style="font-family: Trebuchet MS, sans-serif;">"
>> >> and the ending span were broken email thing but they seem to be in the
>> >> solrconfig.xml file as well. I would start from removing those and
>> >> leaving just the actual definition.
>> >
>> >
>> > Thanks for your response!
>> >
>> > OK so I tried your suggestion of removing those span tags like so:
>> >
>
>
>
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>

Reply via email to