摘要: CommitTracker实现了runnable接口,根据solrconfig配置进行初始化 CommitTracker构造函数 可以看到软提交openSearcher=true,并表示此次为softcommit 而硬提交的openSearcher需要根据配置进行初始化 so,如果继续跟着流程发现D 阅读全文
posted @ 2018-05-16 23:24 mini强 阅读(484) 评论(0) 推荐(0)
摘要: 接上篇 87 synchronized(this) {//构建索引管理对象 88 deleter = new IndexFileDeleter(directory, 89 config.getI... 阅读全文
posted @ 2015-04-23 10:42 mini强 阅读(331) 评论(0) 推荐(0)
摘要: 真正构造IndexWriterIndexWriter indexWriter = new IndexWriter(directory, config);构造过程 1 public IndexWriter(Directory d, IndexWriterConfig conf) throws IO... 阅读全文
posted @ 2015-04-19 12:50 mini强 阅读(355) 评论(0) 推荐(0)
摘要: 不得不说一句,lucene的源码中大多数地方都留有注释,解释的很详细,阅读起来会很方便定义分析器Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_47);以StandardAnalyzer为例,就只加载了stopword和lucene的版... 阅读全文
posted @ 2015-04-18 15:55 mini强 阅读(412) 评论(0) 推荐(0)
摘要: Directory整体流程还是比较简单的,图片借用Directory directory = FSDirectory.open(file);/** Creates an FSDirectory instance, trying to pick the * best implementation... 阅读全文
posted @ 2015-04-17 16:58 mini强 阅读(232) 评论(0) 推荐(0)
摘要: lucene评分公式文档结果:{"id": 4111005,"bookType": 2,"title": "故宫","userId": "xxx","userName": "xxx","routeDays": 1,"startTime": 1310313600000,"cTime": 1407243... 阅读全文
posted @ 2015-04-16 14:33 mini强 阅读(305) 评论(0) 推荐(0)
摘要: 域.fnm的文件结构: Header,FieldsCount, FieldsCount,FooterHeader: 同前文FieldsCount:域的个数FieldsCount:包含FieldsCount个域的信息FieldName:域名FieldNumber:域的编号,不同与先前版本的域的编... 阅读全文
posted @ 2015-04-15 21:50 mini强 阅读(747) 评论(2) 推荐(0)
摘要: 从段的元文件segment_开始所谓元文件就是记录索引中段信息的文件,打开索引文件目录可以发现以segment_开头的文件,这些都是元文件lucene根据segment_后面的数字来确认哪一个文件可以被读取当加载索引文件DirectoryReader.open时,代码如下:针对不同的索引物理存储lu... 阅读全文
posted @ 2015-04-14 16:18 mini强 阅读(767) 评论(0) 推荐(0)
摘要: 评分公式1.coord(q,d),查询覆盖率/** Implemented as overlap / maxOverlap. */ @Override public float coord(int overlap, int maxOverlap) { return overlap / (f... 阅读全文
posted @ 2015-04-13 17:28 mini强 阅读(398) 评论(0) 推荐(0)