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

查看全文
  • 相关阅读:
    asp.net编程基础
    http://blog.csdn.net/pjw100/article/details/5261582
    英雄无敌3版的仙剑奇侠传
    另类DATAGRID数据编辑修改
    使用INDY组件发送邮件,DEMO程序没有讲到的一些内容.如邮件格式定议
    .net 简单实现MD5
    VB.NET 对于类型的传递按值或者按引用
    Start with Database Connection Pool 连接管理
    ASP页面之间传值
    正则表达式
  • 原文地址:https://www.cnblogs.com/chinaniit/p/1506569.html
  • Copyright © 2011-2022 走看看