![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Lucene源码分析
chenxiongdi
这个作者很懒,什么都没留下…
展开
-
Lucene 源码分析集------- BitUtil
const uint8_t BitUtil::ntzTable[] = { 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, ...原创 2019-05-25 12:12:34 · 168 阅读 · 0 评论 -
Lucene 源码分析集------- SmallDouble
SmallDouble 提供了一种压缩方案,将小浮点数压缩到8bit.uint8_t SmallDouble::doubleToByte(double f) { if (f < 0.0) { // round negatives up to zero f = 0.0; } if (f == 0.0) { // zero is a special...原创 2019-05-25 16:06:08 · 187 阅读 · 0 评论 -
Lucene 源码分析集------- Random
生成伪随机数的接口Random::Random() { this->seed = (int64_t)MiscUtils::currentTimeMillis();}Random::Random(int64_t seed) { this->seed = seed;}Random::~Random() {}void Random::setSeed(i...原创 2019-05-25 15:53:31 · 313 阅读 · 0 评论 -
Lucene 源码分析集------- FileUtils
封装了一些文件操作的接口,使用的是boost库里面的文件操作,封装的好处是以后即使不用boost库也不至于影响使用者。namespace FileUtils {/// Return true if given file or directory exists.LPPAPI bool fileExists(const String& path);/// Return file...原创 2019-05-25 15:49:56 · 166 阅读 · 0 评论 -
Lucene 源码分析集------- DocIdBitSet
DocIdBitSet提供基本的数据,以及构造一个DocIdSetIterator 来供外界访问自己。DocId存储在BitSet中的dynamic_bitset中,使用find_next来找到下一个bit为1的doc,也就是存在的doc。这种结构适合于只存储doc id的情形。如果要存储当前分词在本doc中的文本分,这个结构就不适合。/// Simple DocIdSet and ...原创 2019-05-25 15:38:56 · 275 阅读 · 0 评论 -
Lucene 源码分析集------- StringUtils
StringUtils主要提供编码类型转换,字符串转整型,浮点型等接口class LPPAPI StringUtils {public: /// Maximum length of UTF encoding. static const int32_t MAX_ENCODING_UTF8_SIZE; /// Default character radix. ...原创 2019-05-25 14:54:27 · 111 阅读 · 0 评论 -
Lucene 源码分析集------- SyncLock
通用的同步锁/// Utility class to support locking via a mutex.class LPPAPI Synchronize {public: Synchronize(); virtual ~Synchronize();protected: boost::recursive_timed_mutex mutexSynchroni...原创 2019-05-25 14:45:22 · 113 阅读 · 0 评论 -
Lucene 源码分析集------- ThreadPool
线程池实现Future负责具体操作,threadpool负责整体管理和及接口,异步化管理。class Future : public LuceneObject {public: virtual ~Future();protected: boost::any value;public: void set(const boost::any& value)...原创 2019-05-25 13:56:27 · 121 阅读 · 0 评论 -
Lucene 源码分析集------- Base64
mark下base64的封装源码const String Base64::BASE64_CHARS = L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Base64::~Base64() {}String Base64::encode(ByteArray bytes) { return...原创 2019-05-25 12:53:24 · 141 阅读 · 0 评论 -
Lucene 源码分析集------- BitSet & OpenBitSet
这里面主要给boost库里面的dynamic_bitset提供一层封装,主要是区间处理的时候,还有越界时resize,判断是否相等等class LPPAPI BitSet : public LuceneObject {public: BitSet(uint32_t size = 0); virtual ~BitSet(); LUCENE_CLASS(BitSet)...原创 2019-05-25 12:29:21 · 249 阅读 · 0 评论 -
Lucene 源码分析集------- Query
1. 原子query2.需要重写rewrite原创 2019-05-27 20:00:00 · 239 阅读 · 0 评论