Hi
I using fscrawler rest API to index PDF,Word,and text files.
I have requirement to provide index name , when i making HTTP request but seems that it taking default _settings.json configuration to index document.
it not uses pass index name in http request.
_Setting,json
{
"ok": true,
"version": "2.6",
"elasticsearch": "6.8.5",
"settings": {
"name": "test",
"fs": {
"url": "D:\\Elasticsearch-data\\test",
"update_rate": "15m",
"excludes": [
"*/~*"
],
"json_support": false,
"filename_as_id": false,
"add_filesize": true,
"remove_deleted": true,
"add_as_inner_object": false,
"store_source": false,
"index_content": true,
"attributes_support": false,
"raw_metadata": true,
"xml_support": false,
"index_folders": true,
"lang_detect": false,
"continue_on_error": false,
"pdf_ocr": true,
"ocr": {
"language": "eng"
}
},
"elasticsearch": {
"nodes": [
{
"url": "http://172.16.110.74:9200"
}
],
"index": "test",
"index_folder": "test_folder",
"bulk_size": 100,
"flush_interval": "5s",
"byte_size": "10mb"
},
"rest": {
"url": "http://172.16.110.74:7777/fscrawler"
}
}
}
Http Request:
<cfhttp result="resultUpload" method="POST" charset="utf-8" url="http://172.16.110.74:7777/fscrawler/_upload?debug=true">
<cfhttpparam type="formField" name="index" value="test2"/>
<cfhttpparam type="File" name="file" file="D:\\Elasticsearch-data\\PDF-Data\\test.txt">
</cfhttp>
<cfdump var="#resultUpload#">
Response
{
"ok": true,
"filename": "D:\\Elasticsearch-data\\PDF-Data\\test.txt",
"url": "http://172.16.110.74:9200/test/_doc/da749f125747d9b7b3ef5882e401a71",
"doc": {
"content": "heeloo\n",
"meta": {
"raw": {
"X-Parsed-By": "org.apache.tika.parser.DefaultParser",
"Content-Encoding": "ISO-8859-1",
"resourceName": "D:\\Elasticsearch-data\\PDF-Data\\test.txt",
"Content-Type": "text/plain; charset=ISO-8859-1"
}
},
"file": {
"extension": "txt",
"content_type": "text/plain; charset=ISO-8859-1",
"indexing_date": "2019-12-19T11:51:03.484+0000",
"filename": "D:\\Elasticsearch-data\\PDF-Data\\test.txt"
},
"path": {
"virtual": "D:\\Elasticsearch-data\\PDF-Data\\test.txt",
"real": "D:\\Elasticsearch-data\\PDF-Data\\test.txt"
}
}
}
Please suggest.
Thanks,