ファイルの特定の列のみを Solr にインポートしようとしていCSVますが、これを行う方法や、Solr で可能かどうかはわかりません。現在、books.csvSolr のインストールに付属しているサンプルの 1 つを使用しています ( C:\solr-5.2.1\example\exampledocs にあります)。
xml私がファイルに入れた以下schema.xmlは、すべてのフィールドが含まれている場合に機能しますが、いくつかのフィールドをコメントアウトすると、Solr はコメントアウトされた不明なフィールドについて不平を言います。
<uniqueKey>id</uniqueKey>
<!-- Fields added for books.csv load-->
<field name="cat" type="text_general" indexed="true" stored="true"/>
<field name="name" type="text_general" indexed="true" stored="true"/>
<field name="price" type="tdouble" indexed="true" stored="true"/>
<!-- these columns commented out
<field name="inStock" type="boolean" indexed="true" stored="true"/>
<field name="author" type="text_general" indexed="true" stored="true"/>
-->
C:\solr-5.2.1\binのポスト スクリプトはスクリプトshellであり、私が使用している Windows では実行されないため、post.jarファイルと同じ場所にあるファイルを使用する必要がありbooks.csvます。
java -Dtype=text/csv -Durl=http://localhost:8983/solr/jcg/update -jar post.jar books.csv