SOLR索引并提取.sh和.sql文件 [英] SOLR index and extract .sh and .sql files

查看:83
本文介绍了SOLR索引并提取.sh和.sql文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我已经使用SOLR设置了图像.我的目标是在Windows和Linux服务器上建立索引并提取文件.我可以从多种文件类型编制索引并提取数据.这是由SOLR CELL请求处理程序完成的.请参见下面的post.jar cmd.

Recently I have set up an image with SOLR. My goal is to index and extract files on a Windows and Linux server. It is possible for me to index and extract data from multiple file types. This is done by the SOLR CELL request handler. See the post.jar cmd below.

j ava -Dauto-递归-jar post.jar Y:\ SimplePostTool版本1.5将文件发布到基本URL localhost:8983/solr/update ..进入自动模式.所考虑的文件结尾为xml,json,csv,pdf,doc,docx,ppt,pp tx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log进入递归模式,最大深度= 999,延迟= 0 s索引了0个文件.

j ava -Dauto -Drecursive -jar post.jar Y:\ SimplePostTool version 1.5 Posting files to base url localhost:8983/solr/update.. Entering auto mode. File endings considered are xml,json,csv,pdf,doc,docx,ppt,pp tx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log Entering recursive mode, max depth=999, delay=0s 0 files indexed.

是否可以从.sh和.sql等文件类型中索引和提取元数据/内容?如果可能的话,我当然想知道如何:)

Is it possible to index and extract metadata/content from file types like .sh and .sql? If it is possible I would like to know how of course :)

推荐答案

我今天解决了它.我只需要将desh和sql添加到SimplePostTool.Java的mime-map中.

I solved it today. I only needed to add de sh and sql to the mime-map of the SimplePostTool.Java.

mimeMap = new HashMap<>();
mimeMap.put("xml", "text/xml");
mimeMap.put("csv", "text/csv");
mimeMap.put("json", "application/json");
mimeMap.put("pdf", "application/pdf");
mimeMap.put("rtf", "text/rtf");
mimeMap.put("html", "text/html");
mimeMap.put("htm", "text/html");
mimeMap.put("doc", "application/msword");
mimeMap.put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
mimeMap.put("ppt", "application/vnd.ms-powerpoint");
mimeMap.put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
mimeMap.put("xls", "application/vnd.ms-excel");
mimeMap.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
mimeMap.put("odt", "application/vnd.oasis.opendocument.text");
mimeMap.put("ott", "application/vnd.oasis.opendocument.text");
mimeMap.put("odp", "application/vnd.oasis.opendocument.presentation");
mimeMap.put("otp", "application/vnd.oasis.opendocument.presentation");
mimeMap.put("ods", "application/vnd.oasis.opendocument.spreadsheet");
mimeMap.put("ots", "application/vnd.oasis.opendocument.spreadsheet");
mimeMap.put("txt", "text/plain");
mimeMap.put("log", "text/plain");
mimeMap.put("sh", "text/plain");
mimeMap.put("sql", "text/plain");

我还将sh和sql添加到以下代码中:

I also added the sh and sql to the following code:

private static final String DEFAULT_FILE_TYPES = "xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log";

这篇关于SOLR索引并提取.sh和.sql文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆