摘要: 以下为统计media的数量功能,通过solrj,采用了facet方法,类似于sql的分组group by查询;这边的代码只是获取总媒体数量,其实他还有其他功能,去循环solrList的话,可以获取各个媒体的数量public int getMediaCount(Keyword keyword) { HttpSolrServer solrServer = SolrServer.getInstance().getServer(); SolrQuery sQuery = new SolrQuery(); int result = 0; t... 阅读全文
posted @ 2014-01-19 23:59 OnTheRoad_Lee 阅读(570) 评论(0) 推荐(0) 编辑
摘要: 以下转载自:http://hongweiyi.com/2013/03/apache-solr-facet-introduction/1、什么是Faceted SearchFacet['fæsɪt]很难翻译,只能靠例子来理解了。Solr作者Yonik Seeley也给出更为直接的名字:导航(Guided Navigation)、参数化查询(Paramatic Search)。上面是比较直接的Faceted Search例子,品牌、产品特征、卖家,均是Facet。而Apple、Lenovo等品牌,就是Facet values或者说Constraints,而Facet values 阅读全文
posted @ 2014-01-19 23:51 OnTheRoad_Lee 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: 以下是我项目中获取新闻数据列表的写法,包括数据总量、数据列表,接下来会贴出分片查询(facet)等高级查询基本的注释都有了:private ListPage queryFromSolr(NewsQueryParameters queryParameters, Keyword keyword) { ... 阅读全文
posted @ 2014-01-19 15:20 OnTheRoad_Lee 阅读(6668) 评论(9) 推荐(0) 编辑