Solr4.10.2統合Nutch 1.9 UI付きインタフェースとの使用

7648 ワード

原文住所:http://blog.csdn.net/fyfmfof/article/details/42803841
一、Solr 4.10.2とNutch 1.9統合
環境:Solr 4.10.2 Tomcat上に既に設定されているSolrのTomcat構成の詳細はSolr4.10.2のTomcat構成を参照
NUTCH_をDIR/conf/schema-solr4.xmlをSOLR_にコピーHOME/collection 1/conf/,名前をschema.xml、<fields>...</fields>の最後の行<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>を追加
Tomcatを再起動すると、NutchのcrawlコマンドでsolrURLパラメータを付けてインデックスを這い出すことができますNutch 1.9のコマンド使用の詳細はNutch1.9インストール構成と基本的な使用方法の説明を参照してください.
インデックスを取得してsolr管理インタフェースに入ると、solrの下にインデックスされたデータが表示されます.Solr4.10.2集成Nutch1.9与自带UI界面使用_第1张图片
二、Solr 4.10.2のUI付きインタフェース(Solritas)
1.solr-4.10をコピーする.2contribvelocitylibおよびsolr-4.10.2distの下にあるjarパッケージはすべてSOLR_へSERVERWEB-INFlibディレクトリ下
2.前回の統合Nutchを行わなければ、このステップはスキップでき、Nutchを統合する場合は新しいschemaを必要とする.xmlファイルに構成を追加し続ける①</types>の前に追加
<!-- Money/currency field type. Seehttp://wiki.apache.org/solr/MoneyFieldType 
      Parameters:  
        defaultCurrency: Specifies thedefault currency if none specified. Defaults to "USD"  
        precisionStep:   Specifies the precisionStep for the TrieLongfield used for the amount  
        providerClass:   Lets you plug in other exchange providerbackend:  
                        solr.FileExchangeRateProvider is the default and takes one parameter:  
                           currencyConfig:name of an xml file holding exchange rates  
                        solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:  
                           ratesFileLocation:URL or path to rates JSON file (default latest.json on the web)  
                           refreshInterval:Number of minutes between each rates fetch (default: 1440, min: 60)  
--> 
<fieldType name="currency"class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD"  currencyConfig="currency.xml" />  
<!-- boolean type: "true" or "false" --> 
<fieldType name="boolean" class="solr.BoolField"sortMissingLast="true"/>

</fields>に加算
<field name="cat" type="string"indexed="true" stored="true" multiValued="true"/>
<field name="manu_exact" type="string"indexed="true" stored="false"/>
<field name="content_type" type="string"indexed="true" stored="true"multiValued="true"/>
<field name="price" type="float" indexed="true"stored="true"/>
<field name="popularity" type="int"indexed="true" stored="true" />
<field name="inStock" type="boolean"indexed="true" stored="true" />
<dynamicField name="*_s" type="string" indexed="true"  stored="true"/>
<dynamicField name="*_c"  type="currency" indexed="true"  stored="true"/>  
<dynamicField name="*_dt" type="date"   indexed="true"  stored="true"/>

</schema>の前に<copyField source="author" dest="author_s"/> <copyField source="price"dest="price_c"/>を付ける
④中国語分詞は前の方法で配置すればよい、IK分詞器配置詳細はSolr4.10.2のIK Analyzer分詞器構成参照
3.Tomcatを再起動し、http://localhost:8080/solr/browseにアクセスすればSolr4.10.2集成Nutch1.9与自带UI界面使用_第2张图片