`

Solr: Clustering documents with carrot

    博客分类:
  • Solr
 
阅读更多

1. Configure clutering in solrconfig.xml

<searchComponent name="clustering"
                   enable="true"
                   class="solr.clustering.ClusteringComponent" >
    <lst name="engine">
      <str name="name">lingo</str>

      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
      <str name="carrot.resourcesDir">clustering/carrot2</str>
    </lst>

    <lst name="engine">
      <str name="name">stc</str>
      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
    </lst>

    <lst name="engine">
      <str name="name">kmeans</str>
      <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
    </lst>

  </searchComponent>
 <requestHandler name="/clustering"
                  startup="lazy"
                  enable="true"
                  class="solr.SearchHandler">
    <lst name="defaults">
      <bool name="clustering">true</bool>
      <str name="clustering.engine">lingo</str>
      <bool name="clustering.results">true</bool>
      <!-- Field name with the logical "title" of a each document (optional) -->
      <str name="carrot.title">content</str>
      <!-- Field name with the logical "URL" of a each document (optional) -->
      <str name="carrot.url">id</str>
      <!-- Field name with the logical "content" of a each document (optional) -->
      <str name="carrot.snippet">content</str>
      <!-- Apply highlighter to the title/ content and use this for clustering. -->
      <bool name="carrot.produceSummary">true</bool>
      <!-- the maximum number of labels per cluster -->
      <!--<int name="carrot.numDescriptions">5</int>-->
      <!-- produce sub clusters -->
      <bool name="carrot.outputSubClusters">false</bool>

      <!-- Configure the remaining request handler parameters. -->
      <str name="defType">edismax</str>
      <str name="q.alt">*:*</str>
      <str name="rows">10</str>
      <str name="fl">*,score</str>
    </lst>
    <arr name="last-components">
      <str>clustering</str>
    </arr>
  </requestHandler>

2. alter clustering/carrot2/lingo-attributes.xml

          <attribute key="MultilingualClustering.defaultLanguage">
            <value type="org.carrot2.core.LanguageCode" value="CHINESE_SIMPLIFIED"/>
          </attribute>

3. add chinese tokenizer jar to classpath in solrconfig.xml

lucene-analyzers-smartcn-4.7.0.jar

<lib dir="../contrib/analysis-extras/lucene-libs" regex=".*\.jar" />

 

 

 

References

http://wiki.apache.org/solr/ClusteringComponent

http://www.cnblogs.com/tomcattd/archive/2013/08/20/3270143.html

http://carrot2.github.io/solr-integration-strategies/carrot2-3.6.3/index.html

分享到:
评论

相关推荐

    node-solr:Node.js 的 Solr 模块

    Node.js 的 Solr 模块参考Node.js: : Solr: : 使用npm test运行测试。 如果您没有在 127.0.0.1:8983 上运行 Solr,请编辑“test/common.js”。使用示例请参阅使用测试。 这是一个快速示例: var solr = require ( ...

    puppet-ispconfig_solr:在 IspConfig 环境中使用的 solr 包装器

    puppet-ispconfig_solr == 定义:ispconfig_solr::instance 这个定义是 solr::instance 的包装器。 它创建一个 solr 实例并配置它以在 IspConfig 环境中使用 == 参数: [ instance_name ] solr 实例的名称。 实例...

    docker-solr:用于Solr的Docker构建,用于管理官方Docker Hub solr映像

    Apache Solr具有高度的可靠性,可扩展性和容错性,可提供分布式索引,复制和负载平衡查询,自动故障转移和恢复,集中式配置等。 Solr为许多世界上最大的互联网站点提供搜索和导航功能。 在和《 了解更多信息。 ...

    solr:Allegro Common Lisp与Solr的接口

    这是Allegro CL的Solr绑定。 Solr是来自Apache Lucene项目的开源自由文本索引/搜索平台。 有关详细信息,请参见以下URL。 该软件包允许Allegro CL应用程序与正在运行的Solr服务器通信,添加和删除文档以及运行查询以...

    lucene-solr:Apache Lucene和Solr开源搜索软件

    Apache Lucene和Solr Apache Lucene是用Java编写的高性能,功能齐全的文本搜索引擎库。 Apache Solr是使用Java编写并使用Apache Lucene的企业搜索平台。 主要功能包括全文搜索,索引复制和分片以及结果分面和突出...

    mod_search_solr:用于 Solr 支持的 Zotonic 模块

    SOLR 对 Zotonic 的支持 该模块向 Zotonic 添加了对 Solr 的支持。 它内置了 Solr:只需安装此模块即可。 设置完成后,Zotonic 会将其保存的每个资源推送到 Solr,以便可以查询数据库。... {% with m.search

    solr -8.11.1.zip 文件

    solr -8.11.1.zip 文件

    mir-solr:MIR SOLR配置

    "mir-solr:MIR SOLR配置"是一个与Solr相关的项目,可能涉及到在MIR(可能是某种特定的系统或框架)中集成和配置Apache Solr的细节。Apache Solr是一个开源的全文搜索引擎,常用于大数据量、高性能的搜索应用。在MIR...

    docker-compose 构建以solr8.11.1为基础的含中文分词器的镜像

    以solr8.11.1为基础镜像,使用docker-compose构建含中文分词器的新的镜像 文件夹内含有docker-compose.yml脚本、Dockerfile脚本以及构建镜像所需中文分词器ik-analyzer-8.5.0.jar、所有扩展词和停用词相关的配置文件...

    java8看不到源码-ansible-role-solr:yauh.solr-用于设置Solr的Ansible角色

    看不到源码Solr 引导程序 设置 Solr 搜索平台的 Ansible 角色 要求 系统上需要有Java,推荐角色yauh.java8。 角色变量 以下变量可与 solr 角色一起使用: solr_source: http://apache.openmirror.de/lucene/solr # ...

    data_solr:CreateIndexBySolr

    在IT行业中,搜索引擎技术是数据检索的关键组成部分,Apache Solr作为一个高效、可扩展的开源全文搜索引擎,被广泛应用于大数据检索场景。本项目"**data_solr:CreateIndexBySolr**"聚焦于如何使用Solr的Java客户端库...

    nodebb-plugin-solr:使用Apache Solr全文搜索NodeBB

    它的主要功能包括全文搜索,命中突出显示,多面搜索,动态聚类,数据库集成以及丰富的文档(例如Word,PDF)处理。 此插件扩展了NodeBB的功能,以利用Apache Solr的安装作为搜索后端。 配置 通过npm安装此插件: ...

    Laravel-4-Solr:Apache Solr简单查询客户端

    Laravel 4 Apache Solr Laravel 4软件包提供了一个接口,用于通过其静态接口使用(查询) 。安装首先通过Composer安装此软件包。 编辑项目的composer.json文件,以要求davispeixoto/laravel-4-solr 。 "require": {...

    solr笔记solr笔记

    Solr笔记 Solr 是 Apache 下的一个项目,是使用 Java 开发的,全文搜索服务器。Solr 是基于 Lucene 的,它可以独立运行,独立对外提供搜索和索引服务。Solr 提供了一个灵活的全文搜索解决方案,可以满足各种搜索...

    Solr:将solr与spring boot一起使用

    Spring Boot和Solr 在这个示例中,我们看到如何将spring boot与solr一起用作数据库: Sprint Boot平板电脑索尔我们要做的第一件事是在solr de vehicle中创建模式以保存车辆的信息。 使用此命令,我们将使用bash脚本...

    cl-solr:用于 Common Lisp 的 Apache Solr API

    "cl-solr:用于 Common Lisp 的 Apache Solr API" 这个标题揭示了我们讨论的主题是一个名为 "cl-solr" 的软件库,它为 Common Lisp 编程语言提供了与 Apache Solr 的接口。Apache Solr 是一个流行的开源搜索引擎,...

    solr5.4.0完整包

    Solr 依存于Lucene,因为Solr底层的核心技术是使用Lucene 来实现的,Solr和Lucene的本质区别有以下三点:搜索服务器,企业级和管理。Lucene本质上是搜索库,不是独立的应用程序,而Solr是。Lucene专注于搜索底层的...

    solr:Apache Solr开源搜索软件

    阿帕奇·索尔(Apache Solr) Apache Solr是一个用Java编写并使用的企业搜索平台。 主要功能包括全文搜索,索引复制和分片以及结果分面和突出显示。在线文件此自述文件仅包含基本的安装说明。 有关更全面的文档,请...

    solr-clustering

    Solr Clustering是基于Apache Solr搜索引擎的一项功能,用于对搜索结果进行聚类。聚类是一种无监督的机器学习方法,可以将相似的对象组合在一起,同时将不相似的对象分开。Solr Clustering的应用场景广泛,主要用于...

    spring-data-solr:通过spring对solr数据的增删该查,进行封装

    **Spring Data Solr:通过Spring对Solr数据的增删改查封装** Spring Data Solr是Spring Data项目的一部分,它为Apache Solr搜索引擎提供了一种简单而强大的集成方式。Spring Data Solr允许开发者利用Spring框架的...

Global site tag (gtag.js) - Google Analytics