私はsolr 5.3.1でsolrサーバーを実行して作業を開始します:
D:\solr\solr-5.3.1\bin>solr start ;
次に、スタンドアロン モードでコアを作成します。
D:\solr\solr-5.3.1\bin>solr create -c mycore
システム ファイル (word および pdf) からのインデックス作成が必要で、スキーマ API にはドキュメントのフィールド「名前」がないため、curl を使用してこのフィールドを追加します。
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"name",
"type":"text_general",
"stored":true,
“indexed”:true }
}' http://localhost:8983/solr/mycore/schema
そして、Windows SimplepostTools ですべての document.with 再インデックス:
D:\solr\solr-5.3.1>java -classpath example\exampledocs\post.jar -Dauto=yes -Dc=mycore -Ddata=files -Drecursive=yes org.apache.solr.util.SimplePostTool D:\Lucene\document ;
しかし、フィールド「名前」が正常に追加されたとしても、彼は空です。フィールド タイトルは、msword (.doc および .docx) ではなく、pdf ドキュメントのみの名前を取得します。
次に、schema.xml API を使用しないため、techproducts の例を使用したインデックス作成を選択し、スキーマを変更できます。
D:\solr\solr-5.3.1>solr –e techproducts
Techproducts は、インデックス付けされたすべての files.xml の名前を返します。
次に、solr_home example/techproducts/solr に基づいて新しいコアを作成し、デモと呼ばれるこの新しいコアで、techproducts の schema.xml (コンテンツ フィールド「名前」) と solrConfig.xml を使用します。すべてのドキュメントにインデックスを付けたとき、フィールド名は存在しますが、インデックス付けされたすべてのファイルに対してまだ空です。
私の質問は、フィールド「id」やフィールド「ressource_name」のようなパスではなく、各ドキュメント(mswordおよびpdf)の名前だけを取得する方法です。新しい Typefield を作成するか、別の方法で存在する必要があります。