ファイルの特定の列のみを Solr にインポートしようとしていCSV
ますが、これを行う方法や、Solr で可能かどうかはわかりません。現在、books.csv
Solr のインストールに付属しているサンプルの 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