Lucene的平行索引
来源:互联网 发布:java 分布式应用 编辑:程序博客网 时间:2024/06/08 18:23
有时对于一个Document来说,有一些Field会被频繁地操作,而另一些Field则不会。这时可以将频繁操作的Field和其他Field分开存放,而在搜索时同时检索这两部分Field而提取出一个完整的Document。
这要求两个索引包含的Document的数量必须相同。
在创建索引的时候,可以同时创建多个IndexWriter,将一个Document根据需要拆分成多个包含部分Field的Document,并将这些Document分别添加到不同的索引。
而在搜索时,则必须借助ParallelReader类来整合。
Directory dir1=FSDirectory.getDirectory(new File(INDEX_DIR1),false);
Directory dir2=FSDirectory.getDirectory(new File(INDEX_DIR2),false);
ParallelReader preader=new ParallelReader();
preader.add(IndexReader.open(dir1));
preader.add(IndexReader.open(dir2));
IndexSearcher searcher=new IndexSearcher(preader);
之后的操作和一般的搜索相同。
- Lucene的平行索引
- Lucene的平行索引
- Lucene的平行索引
- Lucene的平行索引和同时搜索多个索引
- lucene的索引文件
- lucene的索引结构图
- lucene-索引的合并
- lucene的索引文件
- Lucene的索引详解
- Lucene的索引文件格式
- lucene的索引流程
- Lucene 的索引排序
- Lucene的索引文件格式
- Lucene的索引文件格式
- Lucene索引的建立
- lucene--索引的创建
- lucene(索引的查询)
- Lucene的索引文件格式
- 网址导航站的盈利新模式探讨
- November 17th Monday
- 怎样对SQL Server 2005加密的存储过程进行解密
- unix简史
- varchar and nvarchar and varchar(max) and nvarchar(max) and text and ntext
- Lucene的平行索引
- 为摩卡软件用法律武器维权叫好
- Windows7的OEM激活前提---判断主板BIOS是否为SLIC2.1?
- firefox 插件之旅(一)
- 第一个文章
- test
- 看电视你桌面上有几个遥控器 -- facade模式读后感
- ASP.NET 2.0 实现伪静态网页方法
- 使用VNC连接Linux服务器