Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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
用Solr&;索引postgresqlbytea数据;提卡_Postgresql_Solr_Apache Tika_Richtext_Bytea - Fatal编程技术网

用Solr&;索引postgresqlbytea数据;提卡

用Solr&;索引postgresqlbytea数据;提卡,postgresql,solr,apache-tika,richtext,bytea,Postgresql,Solr,Apache Tika,Richtext,Bytea,以前,我使用Tika&Solr成功地为存储在Oracle中BLOB列中的富文档编制了索引。然而,现在我正试图用PostgreSQL(9.5.1)数据库和Solr(5.5.0)做同样的事情,但无法让它工作。我在谷歌上搜索了很多,没有找到任何关于BYTEA专栏、Tika&Solr的具体信息 我怀疑我的数据源配置错误,但我尝试了每种数据源类型,但都没有成功 在PostgreSQL数据库中,我有一个名为“attachment”的表,其中有一个名为“media”的列,类型为BYTEA。列中存储了丰富的文档

以前,我使用Tika&Solr成功地为存储在Oracle中BLOB列中的富文档编制了索引。然而,现在我正试图用PostgreSQL(9.5.1)数据库和Solr(5.5.0)做同样的事情,但无法让它工作。我在谷歌上搜索了很多,没有找到任何关于BYTEA专栏、Tika&Solr的具体信息

我怀疑我的数据源配置错误,但我尝试了每种数据源类型,但都没有成功

在PostgreSQL数据库中,我有一个名为“attachment”的表,其中有一个名为“media”的列,类型为BYTEA。列中存储了丰富的文档(例如Word文档、JPG、RTF等)

这是data-config.xml的相关部分

<dataSource name="f1" type="FieldStreamDataSource"/>
<dataSource name="db" type="JdbcDataSource" driver="org.postgresql.Driver" 
  url="jdbc:postgresql://<ip_address>/<db_name>" 
  user="<username>" password="<password>"/>
<document>
   <entity name="attachment" dataSource="db" query="select * from attachment">
     <entity name="blob" dataSource="f1" processor="TikaEntityProcessor" url="media" dataField="attachment.MEDIA" format="text" onError="continue">
       <field column="text" name="body" />
     </entity>
   </entity>
</document>
但是,索引中没有与富文档关联的文本。当我转到Logging标记时,我看到了这些错误(附件表的每行一个错误)

我已尝试更改data-config.xml,以便f1数据源的类型为FieldReaderDataSource:

但是,我仍然会出错。这是我在FieldReaderDataSource中看到的错误(附件表中每行一个)


你知道我做错了什么吗?

你找到解决办法了吗?@Bhumikthakkar我从来没有让它起作用。我们最终搬到了另一个项目,所以这并不重要。某个时候,有人又开始了那个项目。也许新版本能解决这个问题,我找到了答案。谢谢:)
<field name="body" type="text_general" indexed="true" stored="true"/>

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.EnglishMinimalStemFilterFactory"/>
    <filter class="solr.EnglishPossessiveFilterFactory"/>
  </analyzer>
</fieldType>
Indexing completed. Added/Updated: 226 documents. Deleted 0 documents. (Duration 02s)
Requests: 1(2/s), Fetched: 226(113/s), Skipped: 0, Processed: 226(113/s)
Thursday, March 02, 2017 3:17:45 PM  ERROR  null  EntityProcessorWrapper  Exception in entity : blob:java.lang.RuntimeException: unsupported type : class java.lang.String
Thursday, March 02, 2017 4:09:19 PM  ERROR  null  EntityProcessorWrapper  Exception in entity : blob:java.lang.ClassCastException: java.io.StringReader cannot be cast to java.io.InputStream