CentOS 7.0 上のファイルシステムに PDF や Excel, Word を置いて全文検索するまでの記録。
systemctl stop firewalld.service
rm -rf elasticsearch-1.2.2 tar xf elasticsearch-1.2.2.tar.gz cd elasticsearch-1.2.2 export _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true" bin/plugin -i elasticsearch/elasticsearch-mapper-attachments/2.0.0 # 謎のプラグインを導入 ./bin/elasticsearch
curl -X PUT localhost:9200/aiueo -d '{ "settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 } } }' curl -X PUT localhost:9200/aiueo/file/_mapping -d '{ "file" : { "properties" : { "file" : { "type" : "attachment" } } } }'
rm -rf apache-manifoldcf-1.6.1 tar xf apache-manifoldcf-1.6.1-bin.tar.gz cd apache-manifoldcf-1.6.1/example/ export _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true" java -jar start.jar
[user2@cent7a ~]$ curl 'localhost:9200/aiueo/_search?q=gcc&pretty' { "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { "total" : 1, "max_score" : 1.2797858, "hits" : [ { "_index" : "aiueo", "_type" : "file", "_id" : "file:/home/user2/doc/gcc_-c_-fpic_bye_c.txt", "_score" : 1.2797858, "_source":{"uri" : "\/home\/user2\/doc\/gcc_-c_-fpic_bye_c.txt", これより右は省略 } ] } }