随笔分类 -  Lucene.net

摘要:原文地址:http://www.cnblogs.com/MeteorSeed/archive/2012/12/24/2703716.html目录一Lucene.Net概述二 分词三 索引四 搜索五 实践中的问题一Lucene.Net概述 Lucene.Net是一个C#开发的开源全文索引库,其源码包括“核心”与“外围”两部分。外围部分实现辅助功能,而核心部分包括:Lucene.Net.Index 提供索引管理,词组排序。Lucene.Net.Search 提供查询相关功能。Lucene.Net.Store 支持数据存储管理,主要包括I/O操作。Lucene.Net.Util 公共类。Lucen. 阅读全文
posted @ 2013-04-19 15:20 Servant 阅读(320) 评论(0) 推荐(0)
摘要:1. 基本应用 using System;using System.Collections.Generic;using System.Text;using Lucene.Net;using Lucene.Net.Analysis;using Lucene.Net.Analysis.Standard;using Lucene.Net.Documents;using Lucene.Net.Index;using Lucene.Net.QueryParsers;using Lucene.Net.Search;using Lucene.Net.Store;using Lucene.Net.Util; 阅读全文
posted @ 2013-04-19 10:25 Servant 阅读(211) 评论(1) 推荐(1)
摘要:写全文检索模块涉及到权重的时候,不论怎么设置权重,查看检索出来的权重都是1,以为自己写错了,但是文档的得分却发生了变化。在解决所有问题以后发现了这片文章...转载过来方便大家遇到相同问题的时候不要过度的困扰...今天写了个单元测试,看看权重的变化,结果发现索引的时候啥都好好的,索引完拿出来看都是1,困惑了好一会,还好lucene的文档给出了解释:getBoostpublic float getBoost()Returns, at indexing time, the boost factor as set bysetBoost(float).Note that once a document 阅读全文
posted @ 2013-04-18 16:33 Servant 阅读(427) 评论(0) 推荐(0)
摘要:本文转自:http://www.cnblogs.com/peida/archive/2008/11/27/1341920.html在Lucene.net实现自定义排序,需要实现两个Lucene.Net.Search的两个接口: 1 public interface SortComparatorSource 2 { 3 ScoreDocComparator NewComparator(IndexReader reader , System.String fieldname) ; 4 } 5 6 public interface ScoreDocComparator 7 { 8 in... 阅读全文
posted @ 2013-04-17 15:51 Servant 阅读(319) 评论(0) 推荐(0)