0

SOlr/Carrot2 集成

我有多个文本文件,每个我创建 XML 来索引 Solr 上的文档,如下所示

<add>
  <doc>
    <person>data </person>
    <organization>data here </organization>
    <content>Some spanish text here</content >
  </doc>
<add>

索引中使用的模式

<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />    
<field name="person" type="string"  indexed="true" stored="true" required="true" multiValued="true" />
<field name="orgnization" type="string" indexed="true" stored="true" required="true" multiValued="true"   />
<field name="content" type="text_es" indexed="true" stored="true" multiValued="true"/>  
<field name="location" type="string"  indexed="true" stored="true" required="true" multiValued="true" />

现在我正在尝试集成carrot2集群,为此我点击了这个链接 http://carrot2.github.io/solr-integration-strategies/carrot2-3.8.0/index.html

我的问题是集群查询的结果,我只得到一个集群,如下所示

<arr name="clusters">
  <lst>
<arr name="labels">
  <str>Other Topics</str>
    </arr>
    <double name="score">0.0</double>
    <bool name="other-topics">true</bool>
    <arr name="docs">
      <str>#.txt</str>
      <str>abci-britanicos-pizzerias-201312120250.txt</str>
      <str>abci-arqueologos-israelis-descubren-primer-201312111303.txt</str>
      <str>abci-autoridad-fiscal-pensiones-201312111956.txt</str>
      <str>abci-buenas-razones-para-cambiar-201312110933.txt</str>
      <str>abci-audio-asamblea-aserpinto-201312112139.txt</str>
      <
    </arr>
  </lst>
  </arr>

我应该得到更多的集群 我的语料库包含 60 个文本文档

4

2 回答 2

1

除了 Stanislaw 所说的关于存储字段的内容之外,请提供您用于集群的查询,理想情况下,提供用于索引数据的完整模式。

如果您的索引中只有 60 个文档,并且查询匹配一小部分文档,那么将没有任何可聚类的内容。

于 2013-12-13T11:17:37.347 回答
1

为了使搜索结果聚类在 Solr 中工作,必须存储您为聚类传递的标题和内容字段。Solr 模式中的声明可能如下所示:

<field name="content" type="text" indexed="true" stored="true" />
于 2013-12-13T11:13:24.573 回答