2013-08-14 2 views
3

Я запускаю Solr 4.4 под Tomcat в среде Windows. Я установил DataImportHandler и попытался извлечь данные из SQL Server Express 2012. TCP/IP включен в экземпляре SQL Server.Solr - DataImportHandler: Ошибка индексирования. Откат всех изменений

Когда я запускаю индексную процедуру (http://server.com:8080/solr/dataimport?command=full-import), я получаю сообщение об ошибке «Индексация не удалась. Отбросил все изменения».

отклика

<response> 
<lst name="responseHeader"> 
<int name="status">0</int> 
<int name="QTime">7</int> 
</lst> 
<lst name="initArgs"> 
<lst name="defaults"> 
<str name="config">data-config.xml</str> 
</lst> 
</lst> 
<str name="command">full-import</str> 
<str name="status">idle</str> 
<str name="importResponse"/> 
<lst name="statusMessages"> 
<str name="Time Elapsed">0:1:19.495</str> 
<str name="Total Requests made to DataSource">1</str> 
<str name="Total Rows Fetched">0</str> 
<str name="Total Documents Processed">0</str> 
<str name="Total Documents Skipped">0</str> 
<str name="Full Dump Started">2013-08-14 11:20:59</str> 
<str name="">Indexing failed. Rolled back all changes.</str> 
<str name="Rolledback">2013-08-14 11:21:28</str> 
</lst> 
<str name="WARNING"> 
This response format is experimental. It is likely to change in the future. 
</str> 
</response> 

лаглинь из интерфейса администратора Solr

12:24:08 WARN SimplePropertiesWriter Unable to read: dataimport.properties 

solrconfig.xml RequestHandler

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

данные-config.xml

<dataConfig> 
    <dataSource type="JdbcDataSource" 
     driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
     url="jdbc:sqlserver://localhost\SQLEXPRESS2012;databaseName=dbname" 
     user="username" 
     password="password" 
     batchSize="-1" /> 

    <document name="products"> 
    <entity name="product" query=" 
     SELECT 

     ProductID, 
     ProductNumber, 
     ProductName, 
     ProductShortDescription, 
     ProductLongDescription, 
     ProductPrice, 
     ProductStock, 
     ProductWeight, 
     ProductVolume, 
     ProductRating, 
     color, 
     capacity, 
     suctionpower, 
     noise, 
     energyefficiency, 
     centrifugation, 
     washingcapacity, 
     automaticdefrosting, 
     bestintest, 
     greenenergy, 
     discount, 
     testwinner, 
     funded, 
     productsubname, 
     werecommend 

     FROM EcomProducts"> 

     <field column="ProductID" name="ProductID"/> 
     <field column="ProductNumber" name="ProductNumber"/> 
     <field column="ProductName" name="ProductName"/> 
     <field column="ProductShortDescription" name="ProductShortDescription"/> 
     <field column="ProductLongDescription" name="ProductLongDescription"/> 
     <field column="ProductPrice" name="ProductPrice"/> 
     <field column="ProductStock" name="ProductStock"/> 
     <field column="ProductWeight" name="ProductWeight"/> 
     <field column="ProductVolume" name="ProductVolume"/> 
     <field column="ProductRating" name="ProductRating"/> 
     <field column="color" name="color"/> 
     <field column="capacity" name="capacity"/> 
     <field column="suctionpower" name="suctionpower"/> 
     <field column="noise" name="noise"/> 
     <field column="energyefficiency" name="energyefficiency"/> 
     <field column="centrifugation" name="centrifugation"/> 
     <field column="washingcapacity" name="washingcapacity"/> 
     <field column="automaticdefrosting" name="automaticdefrosting"/> 
     <field column="bestintest" name="bestintest"/> 
     <field column="greenenergy" name="greenenergy"/> 
     <field column="discount" name="discount"/> 
     <field column="testwinner" name="testwinner"/> 
     <field column="funded" name="funded"/> 
     <field column="productsubname" name="productsubname"/> 
     <field column="werecommend" name="werecommend"/> 

    </entity> 
    </document> 
</dataConfig> 

schema.xml

<fields> 

<field name="ProductID" type="string" indexed="true" stored="false" required="true" /> 
<field name="ProductNumber" type="string" indexed="true" stored="true" required="true" /> 
<field name="ProductName" type="string" indexed="true" stored="true" required="true" /> 
<field name="ProductShortDescription" type="string" indexed="true" stored="false" required="true" /> 
<field name="ProductLongDescription" type="string" indexed="true" stored="false" required="true" /> 
<field name="ProductPrice" type="float" indexed="true" stored="false" required="true" /> 

<field name="ProductStock" type="float" indexed="true" stored="false" required="false" /> 
<field name="ProductWeight" type="float" indexed="true" stored="false" required="false" /> 
<field name="ProductVolume" type="float" indexed="true" stored="false" required="false" /> 
<field name="ProductRating" type="float" indexed="true" stored="false" required="false" /> 
<field name="color" type="string" indexed="true" stored="false" required="false" /> 
<field name="capacity" type="string" indexed="true" stored="false" required="false" /> 
<field name="suctionpower" type="string" indexed="true" stored="false" required="false" /> 
<field name="noise" type="string" indexed="true" stored="false" required="false" /> 
<field name="energyefficiency" type="string" indexed="true" stored="false" required="false" /> 
<field name="centrifugation" type="string" indexed="true" stored="false" required="false" /> 
<field name="washingcapacity" type="string" indexed="true" stored="false" required="false" /> 
<field name="automaticdefrosting" type="boolean" indexed="true" stored="false" required="false" /> 
<field name="bestintest" type="boolean" indexed="true" stored="false" required="false" /> 
<field name="greenenergy" type="boolean" indexed="true" stored="false" required="false" /> 
<field name="discount" type="string" indexed="true" stored="false" required="false" /> 
<field name="testwinner" type="boolean" indexed="true" stored="false" required="false" /> 
<field name="funded" type="string" indexed="true" stored="false" required="false" /> 
<field name="productsubname" type="string" indexed="true" stored="false" required="false" /> 
<field name="werecommend" type="boolean" indexed="true" stored="false" required="false" /> 
<!-- Main body of document extracted by SolrCell. 
     NOTE: This field is not indexed by default, since it is also copied to "text" 
     using copyField below. This is to save space. Use this field for returning and 
     highlighting document content. Use the "text" field to search the content. --> 
    <field name="content" type="text_general" indexed="false" stored="true" multiValued="true"/> 


    <!-- catchall field, containing all other searchable text fields (implemented 
     via copyField further on in this schema --> 
    <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/> 

    <!-- catchall text field that indexes tokens both normally and in reverse for efficient 
     leading wildcard queries. --> 
    <field name="text_rev" type="text_general_rev" indexed="true" stored="false" multiValued="true"/> 

    <!-- non-tokenized version of manufacturer to make it easier to sort or group 
     results by manufacturer. copied from "manu" via copyField --> 
    <field name="manu_exact" type="string" indexed="true" stored="false"/> 

    <field name="payloads" type="payloads" indexed="true" stored="true"/> 

    <field name="_version_" type="long" indexed="true" stored="true"/> 


</fields> 
<uniqueKey>ProductID</uniqueKey> 
<copyField source="ProductName" dest="text"/> 
<defaultSearchField>text</defaultSearchField> 

Каталина авторизуйтесь

aug 14, 2013 11:20:52 AM org.apache.catalina.core.AprLifecycleListener init 
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Tomcat\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;;. 
aug 14, 2013 11:20:52 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-bio-8080"] 
aug 14, 2013 11:20:52 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 374 ms 
aug 14, 2013 11:20:52 AM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Catalina 
aug 14, 2013 11:20:52 AM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42 
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.HostConfig deployDescriptor 
INFO: Deploying configuration descriptor C:\Tomcat\conf\Catalina\localhost\solr.xml 
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.HostConfig deployDescriptor 
WARNING: A docBase c:\Tomcat\webapps\solr.war inside the host appBase has been specified, and will be ignored 
aug 14, 2013 11:20:52 AM org.apache.catalina.startup.SetContextPropertiesRule begin 
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property. 
aug 14, 2013 11:20:52 AM org.apache.tomcat.util.digester.Digester endElement 
WARNING: No rules found matching 'Context/environment'. 
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory C:\Tomcat\webapps\docs 
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory C:\Tomcat\webapps\host-manager 
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory C:\Tomcat\webapps\manager 
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory C:\Tomcat\webapps\ROOT 
aug 14, 2013 11:20:54 AM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
aug 14, 2013 11:20:54 AM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
aug 14, 2013 11:20:54 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 1838 ms 

Любая идея о том, как это исправить, или что посмотреть в ?

ответ

2

Я хотел бы добавить комментарий, но не имеют репутацию :(

вы проверили:

solr dataimport error: Indexing failed. Rolled back all changes

SOLR: Indexing failed. Rolled back all changes.

http://mail-archives.apache.org/mod_mbox/lucene-solr-user/200912.mbox/%[email protected]%3E

Вы получаете предупреждение " SimplePropertiesWriter Не удалось прочитать: dataimport.properties ", было предложено для создания пустого файла с именем dataimport.properties в вашем каталоге conf и не забудьте убедиться, что система имеет к нему доступ на запись.

+0

Спасибо! Создание /conf/dataimport.properties исправлено предупреждение. Однако импорт все еще не работает. Я буду изучать ваши URL-адреса и отлаживать их дальше. Еще раз спасибо. – egeek

+0

Проверьте правильность настройки - http://amac4.blogspot.co.uk/2013/08/configuring-solr-4-data-import-handler.html –

+0

Я следил за всеми вашими гидами и перепроверял каждую конфигурацию, но все еще не удается найти ошибку. Я подозреваю, что причина может заключаться в файле data-config.xml или schema.xml. Я сократил до самых основных настроек, но без везения. – egeek

1

Существует ли файл dataimport.properties и проверьте, что он не защищен от записи.

Я нашел это в вики

Когда команда полного импорта выполняется, он сохраняет время начала операции в файле, расположенном на Conf/dataimport.properties (этот файл настраивается)

подробнее http://wiki.apache.org/solr/DataImportHandler#Commands

+0

Спасибо! Создание /conf/dataimport.properties исправлено предупреждение. – egeek

0

у меня был эта проблема - перезапуск кота решил его ... так: обслуживания tomcat7 перезапуска

+0

Будьте очень осторожны с этим - разработчик сделал это в нашей компании и уничтожил все данные – Phas1c

Смежные вопросы