簡體   English   中英

collection1:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:在字段Report_Name上指定了未知字段類型'text'

[英]collection1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Unknown fieldtype 'text' specified on field Report_Name

我正在按照http://www.sunilgulabani.com/2013/01/import-mysql-database-with-apache-solr.html中的說明進行操作 我已經將data-config.xml修改為:-

<dataConfig>
    <dataSource driver="sun.jdbc.odbc.JdbcOdbcDriver" type="JdbcDataSource"
       url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + "C:\\users\\ppreeti\\executive_db.accdb" user="" password="" />
    <document name="products">
       <entity name="Report" query="select * from Report">
           <field column="Report_Name" name="Report_Name" />
           <field column="Report_ID" name="Report_ID" />
           <field column="Section_ID" name="Section_ID" />
           <field column="Contact_ID" name="Contact_ID" />
           <field column="ZipFile_IND" name="ZipFile_IND" />
           <field column="Last_Update" name="Last_Update" />
           <field column="Link" name="Link" />
           <field column="link_id" name="link_id" />
           <!--<entity name="Contact" query="select Contact_Name from Contact where item_id='${item.ID}'">
               <field name="features" column="description" />
           </entity>
           <entity name="item_category" query="select CATEGORY_ID from item_category where item_id='${item.ID}'">
               <entity name="category" query="select description from category where id = '${item_category.CATEGORY_ID}'">
                   <field column="description" name="cat" />
               </entity>
           </entity>-->
       </entity>
    </document>
</dataConfig> 

我也沒有遵循本教程中提到的步驟4,因為我正在訪問MS Access數據庫,並且發現它是內置的。

我還通過在標記之前添加以下幾行,在另一個教程之后修改了schema.xml :-

<fields>

    <field name="Report_Name" type="text" indexed="true" stored="true" required="true"/>
    <field name="Report_ID" type="text" indexed="true" stored="true" required="true"/>
    <field name="Section_ID" type="text" indexed="true" stored="true" required="true"/>
    <field name="Contact_ID" type="text" indexed="true" stored="true" required="true"/>
    <field name="ZipFile_IND" type="text" indexed="true" stored="true" required="true"/>
    <field name="Last_Update" type="text" indexed="true" stored="true" required="true"/>
    <field name="Link" type="text" indexed="true" stored="true" required="true"/>
    <field name="link_id" type="text" indexed="true" stored="true" required="true"/>


    <dynamicField name="*" type="ignored" />
 </fields>

 <uniqueKey>Report_ID</uniqueKey>
 <!-- field for the QueryParser to use when an explicit fieldname is absent -->
 <defaultSearchField>Report_Name</defaultSearchField>

因此,當我按照步驟5所述在瀏覽器上運行時,出現以下錯誤:-collection1:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:在上指定了未知字段類型'text'字段Report_Name

那么,我該如何解決錯誤?

在默認的solrconfig.xml文件中不再定義text的fieldType。 嘗試更改schema.xml文件中的所有字段以使用type="text_general"因為這是在當前solrconfig.xml文件中找到的合適替代項。

我還建議您在安裝中查看solrconfig.xml文件,並閱讀Solr Wiki上的“ 分析器”,“標記器”和“標記過濾器”頁面,以更好地了解如何設置fieldType定義。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM