---
title: "lucene index 最简理解(实战中用到后继续更新)"
author: "自治州"
date: "2014-01-19T09:27:18Z"
tags: []
categories: ["开源软件"]
slug: "lucene-index"
draft: false
lastmod: "2014-01-19T09:27:18Z"
id: 2007017
url: "https://puretech.iteye.com/blog/2007017"
---

lucene适用于unstructured data 存储, 相对于DBMS, 他能够提供独有匹配指数的搜索结果.

 

从技术上说, lucene index将一系列的document (由filed组成)index成为一个文件. (Index用的是IndexWriter类. 其中, 对于原始文件可以用不同的analyzer parse. ) 然后, 可以快速的search这个indexed文件, 用IndexSearcher类. IndexSearcher需要一个RequestParser的object. RequestParser的作用是parse query string. 它也需要用到analyzer. **注意, RequestParser和IndexWriter的analyzer需一致.**

 

References: [http://oak.cs.ucla.edu/cs144/projects/lucene/](http://oak.cs.ucla.edu/cs144/projects/lucene/)

 

\*基于lucene2.0. 目前lucene的版本为4.6