Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java中包含html的Solrj索引字符串_Java_Html_Solr_Solrj - Fatal编程技术网

java中包含html的Solrj索引字符串

java中包含html的Solrj索引字符串,java,html,solr,solrj,Java,Html,Solr,Solrj,我知道如何使用以下工具为下载的html页面编制索引: ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract"); up.addFile(new File(fileName), solrId); up.setParam("literal.id", solrId); up.setAction(ACTION.COMMIT, true, true); getServ

我知道如何使用以下工具为下载的html页面编制索引:

ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");

    up.addFile(new File(fileName), solrId);
    up.setParam("literal.id", solrId);
    up.setAction(ACTION.COMMIT, true, true);
    getServer().request(up);

如果html页面是一个字符串
string mystring
我如何在不将其保存到文件并再次读取的情况下对其进行索引?

使用
addFile
方法,而不是使用
addContentStream
ContentStreamBase.StringStream
方法。这将使CeontentStreamUpdateRequest从
字符串而不是文件中提取数据

相关文件:


谢谢,这正是我想要的!