Solr之自动聚类。
来源:互联网 发布:珍嗖啦淘宝上是真的吗 编辑:程序博客网 时间:2024/06/06 06:54
Solr使用Carrot2完成了聚类功能,能够把检索到的内容自动分类,Carrot2聚类示例:
要想Solr支持聚类功能,首先要把Solr发行包中的dist/solr-clustering-4.2.0.jar,复制到\solr\contrib\analysis-extras\lib下,然后打开sonlrconfig.xml进行添加配置:
<searchComponent name = "clustering" enable = "${solr.clustering.enabled:true}" class = "solr.clustering.ClusteringComponent">
<lst name = "engine">
<str name = "name">default</str>
<str name = "carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
<str name = "LingoClusteringAlgorithm.desiredClusterCountBase">30</str> <!-- 2~100 -->
<str name = "LingoClusteringAlgorithm.clusterMergingThreshold">0.70</str> <!-- 0~1 -->
<str name = "LingoClusteringAlgorithm.scoreWeight">0</str> <!-- 0~1 -->
<str name = "LingoClusteringAlgorithm.labelAssigner">org.carrot2.clustering.lingo.SimpleLabelAssigner</str> <! -- org.carrot2.clustering.lingo.UniqueLabelAssigner -->
<str name = "LingoClusteringAlgorithm.phraseLabelBoost">1.5</str> <!-- 0~10 -->
<str name = "LingoClusteringAlgorithm.phraseLengthPenaltyStart">8</str> <!-- 2~8 -->
<str name = "LingoClusteringAlgorithm.phraseLengthPenaltyShop">8</str> <!-- 2~8 -->
<str name = "TermDocumentMatrixReducer.factorizationQuality">HIGH</str> <!-- LOW,MEDIUM,HIGH -->
.......</lst>
</searchComponent>
配好了聚类组件后,下面配置requestHandler:
<requestHandler name = "/clustering" startup = "lazy" enable = "${solr.clustering.enabled:true}" class = "solr.SearchHandler">
<lst name = "default">
<str name = "echoParams">explicit</str>
<bool name = "clustering">true</bool>
<str name = "clustering.engine">default</str>
<bool name = "clustering.results">default</bool>
<str name = "carrot.title">category_s</str>
<str name = "carrot.snippet">content</str>
<str name = "carrot.url">path</str>
<str name = "carrot.produceSummary">true</str>
</lst>
<arr name = "last-components">
<str>clustering</str>
</arr>
</requestHandler>
有两个参数要注意carrot.title,carrot.snippet是聚类的比较计算字段,这两个参数必须是stored="true",carrot.title的权重要高于carrot.snippet,如果只有一个做计算的字段carrot.snippet可以去掉(是去掉不是值为空)。设完了用下面的URL就可以查询了。
http://localhost:8080/skyCore/clustering?q=*3A*&wt=xml&indent=true
- Solr之自动聚类。
- solr 自动聚类
- solr 4.0 启用 自动聚类组件 carrot 的方法
- 搜索引擎之阿堂Solr学习笔记系列7(进阶篇:Solr的自动补全功能)
- 【杂谈】Solr的自动聚类carrot2和facet关系和比较
- solr自动补全
- solr 自动提示
- Solr自动完成示例
- solr学习之-solr安装
- Solr之配置文件solr.xml。
- solr的自动补全
- solr 自动提交autocommit(原创)
- Solr通过配置自动Commit
- solr配置自动增量更新
- 用solr自动补全
- solr配置自动增量更新
- solr配置自动生成id
- Solr自动生成ID配置
- mysql数据库sql语句通过DATE_FORMAT格式化日期
- JAVA课程3 1+2+3+n<8888的最大正整数 N
- 去广告神器的实现
- <并查集>luogu 1196 银河英雄传说
- 201612-4 压缩编码 ccf
- Solr之自动聚类。
- 扫荡倾斜摄影单体化难题
- 8
- struts2重点、精华、用法总结(六):数据处理机制之值栈
- Postgres修改logging_collector参数后reload报错的迷惑
- ROS中发布点云信息和里程计消息
- Android 4.4 SystemUI 的面板quicksettings删除
- 解决 Manifest.permission 中 permission无法解析的问题
- Median of Two Sorted Arrays