我正在尝试对 microsoft office 的所有产品进行索引和搜索。我发现它不适用于 excel 二进制书(.xlsb)。
我已成功执行索引,但无法从中找到单词。
我试过以下步骤:
curl -X PUT "localhost:9200/test/attachment/_mapping" -d '{
"attachment" : {
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"title" : { "store" : "yes" },
"file" : { "term_vector":"with_positions_offsets", "store":"yes" }
}
}
}
}
}'
coded=`cat test.xlsb | perl -MMIME::Base64 -ne 'print encode_base64($_)'`
json="{\"file\":\"${coded}\"}"
echo "$json" > json.file
curl -X POST "localhost:9200/test/attachment/" -d @json.file
curl "localhost:9200/_search?pretty=true" -d '{
"fields" : ["title"],
"query" : {
"query_string" : {
"query" : "sheet"
}
},
"highlight" : {
"fields" : {
"file" : {}
}
}
}'