zoukankan      html  css  js  c++  java
  • Lucene 2

       Lucene NameSpace

                  namespace.bmp

  • Lucene.Net.Analysis defines an abstract Analyzer API for converting text from a java.io.Reader into a TokenStream, an enumeration of Tokens.  A TokenStream is composed by applying TokenFilters to the output of a Tokenizer.  A few simple implemenations are provided, including StopAnalyzer and the grammar-based StandardAnalyzer.
  • Lucene.Net.Documents provides a simple Document class.  A document is simply a set of named Fields, whose values may be strings or instances of java.io.Reader.
  • Lucene.Net.Index provides two primary classes: IndexWriter, which creates and adds documents to indices; and IndexReader, which accesses the data in the index.
  • Lucene.Net.Search provides data structures to represent queries (TermQuery for individual words, PhraseQuery for phrases, and BooleanQuery for boolean combinations of queries) and the abstract Searcher which turns queries into Hits. IndexSearcher implements search over a single IndexReader.
  • Lucene.Net.QueryParsers uses JavaCC to implement a QueryParser.
  • Lucene.Net.Store defines an abstract class for storing persistent data, the Directory, a collection of named files written by an IndexOutput and read by an IndexInput.  Two implementations are provided, FSDirectory, which uses a file system directory to store files, and RAMDirectory which implements files as memory-resident data structures.
  • Lucene.Net.Util contains a few handy data structures, e.g., BitVector and PriorityQueue.
  • ------------------------------------------------------------------------------------------------------------------------------------------------

      Lucene 常用类:

        Lucene.Net.Search.IndexSearcher - 使用IndexSearcher执行所有的实际中用到的搜索,当完成
        执行一个查询的时候,IndexSearcher打开索引目录(只读)
        Lucene.Net.Index.Term - Term是搜索的最基本数据,Term是由两部分组成,我们要搜索的名字和
        对应的值。


        Lucene.Net.Search.Query - 一个类通过IndexSearcher执行来提供结果数据,Query是一个抽象类,
        在上面的示例代码中,我们使用了TermQuery对象生成一个查询语句,还有很多其它方法来创建查询
        语句,除了TermQuery,还有BooleanQuery、PhraseQuery、PrefixQuery、PhrasePrefixQuery、
        RangeQuery、FilteredQuery、SpanQuery。


        Lucene.Net.Search.Hits - 搜索返回的一系列文档,Hits对象能循环获取,负责从搜索中获取文档
        对于大量的索引,不推荐用循环获取所以的搜索结果,最初Hits不要加载所有的文档,只加载一部分
        文档,获取到Hits对象后,就可以利用Doc方法从单一的Hits中返回关联的文档。

  • Lucene:利用Lucene打造站内搜索引擎的思路

  • Url:【http://www.cnblogs.com/lihuimingcn/archive/2008/11/25/1340468.html

查看全文
  • 相关阅读:
    【第五章】printf输出顺序
    【转载】面试_现在有4个石头,1000层的楼房,需要测定这个石头破碎的高度。求最少多少次一定可以测出来。
    卷积和积分运算
    【转载】SIFT算法分析(草稿)
    【第五章】指针类型转换
    【第八章】zigzag数组输出
    【转载】SURF算法源码分析(草稿)
    【第六章】const函数改变变量的值——mutable
    Surf算法
    jsp页面中文乱码总结
  • 原文地址:https://www.cnblogs.com/chinaniit/p/1506569.html
  • Copyright © 2011-2022 走看看