C# solr pdf提取可以工作,但没有索引

C# solr pdf提取可以工作,但没有索引,c#,apache,solr,solrnet,C#,Apache,Solr,Solrnet,我与solr合作提取pdf文件并为其编制索引。现在我可以用以下代码提取它: private static void IndexPDFFile(ISolrOperations<Article> solr) { string filecontent = null; using (var file = File.OpenRead(@"C:\\cookbook.pdf")) { var response = solr.Extract(new Extr

我与solr合作提取pdf文件并为其编制索引。现在我可以用以下代码提取它:

private static void IndexPDFFile(ISolrOperations<Article> solr)
{
    string filecontent = null;

    using (var file = File.OpenRead(@"C:\\cookbook.pdf"))
    {
        var response = solr.Extract(new ExtractParameters(file, "abcd1")
        {
            ExtractOnly = true,
            ExtractFormat = ExtractFormat.Text,
        });

        filecontent = response.Content;
    }
    solr.Commit();
}

pdf文件的内容是:这是一本Solr食谱。。。 字段作者应该包含一些带有admin的内容

以下是输出:

    <response><lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
<lst name="params"><str name="q">text:Solr</str></lst></lst><result name="response" numFound="0" start="0"/></response>

0
1.
文本:Solr
对这个问题有什么建议吗

谢谢,
tro

这是因为您在
提取参数中设置了
ExtractOnly=true
。下面是源代码中ExtractOnly参数的注释

    /// <summary>
    /// If true, return the extracted content from Tika without indexing the document. 
    /// This literally includes the extracted XHTML as a string in the response. 
    /// </summary>
    public bool ExtractOnly { get; set; }
//
///如果为true,则返回从Tika提取的内容,而不为文档编制索引。
///这实际上将提取的XHTML作为字符串包含在响应中。
/// 
公共bool ExtractOnly{get;set;}

如果要为提取的内容编制索引,请不要将此参数设置为true。

这是因为您已在
提取参数中设置了
ExtractOnly=true
。下面是源代码中ExtractOnly参数的注释

    /// <summary>
    /// If true, return the extracted content from Tika without indexing the document. 
    /// This literally includes the extracted XHTML as a string in the response. 
    /// </summary>
    public bool ExtractOnly { get; set; }
//
///如果为true,则返回从Tika提取的内容,而不为文档编制索引。
///这实际上将提取的XHTML作为字符串包含在响应中。
/// 
公共bool ExtractOnly{get;set;}
如果要为提取的内容编制索引,请不要将此参数设置为true

    /// <summary>
    /// If true, return the extracted content from Tika without indexing the document. 
    /// This literally includes the extracted XHTML as a string in the response. 
    /// </summary>
    public bool ExtractOnly { get; set; }