zoukankan      html  css  js  c++  java
  • Lucene的使用(一)

    Lucene是一个全文检索类库(Library),基本原理是索引检索.在搜索引擎领域,Lucene的影响非常大.在这里就不介绍了,这方面网上文章很多.这里主要通过一个本地文件检索程序来简单学习一下Lucene的基本使用.

    利用Lucene来建立检索系统主要有以下几步:首先是建立索引,然后再对索引进行检索,当然分析器贯穿始终.

    (1)建立索引

    Code

    (2)利用索引查询

    Code

    我对Lucene.Net的api文档下的2465个文件做了一个测试.运行程序输入:MySearcher -file MSDN.

    结果如下:

    另附源代码:

    源代码

  • 相关阅读:
    beautifulsoup的一些使用
    requests(爬虫常用)库的使用
    find a maximum product triplet in this array
    Minimum difference between two arrays
    [LeetCode] Binary Tree Upside Down
    n 刀切多少块pizza
    Biased Random Number Generator
    linked list焦点问题,面经里很多,考虑相交不相交,有环无环 + Find Leaves of Binary Tree (Java)
    replace string use another
    Union and Intersection of two sorted list
  • 原文地址:https://www.cnblogs.com/hustcat/p/1269272.html
Copyright © 2011-2022 走看看