Lucene entry-install and run the Demo program and lucene entry demo program

Source: Internet
Author: User

Lucene entry-install and run the Demo program and lucene entry demo program

What is Lucene?

Lucene is a high-performance and scalable library of information retrieval tools. -Lucene In Action

Lucene version: 7.1

1. Download the installation package

Https://lucene.apache.org/core/downloads.html

Ii. Installation

Add four necessary jar packages and paths to CLASSPATH

Lucene-7.1.0 \ core \ lucene-core-7.1.0.jar

\ Lucene-7.1.0 \ queryparser \ lucene-queryparser-7.1.0.jar

\ Lucene-7.1.0 \ analysis \ common \ lucene-analyzers-common-7.1.0.jar

\ Lucene-7.1.0 \ demo \ lucene-demo-7.1.0.jar

Iii. Test

1. Create an index

Java org. apache. lucene. demo. IndexFiles-docs {path-to-lucene}

Path-to-lucene: directory for which the index is to be created

2. Search for Indexes

Java org. apache. lucene. demo. SearchFiles
Enter the content you want to search.


3. Demo source code

IndexFiles. java: Create an index

SearchFiles. java: Search

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.