Lucene常用知識點

2021-10-03 05:04:05 字數 2829 閱讀 7512

lucene:是乙個開放源**的全文檢索引擎工具包,但它不是乙個完整的全文檢索引擎,而是乙個全文檢索引擎的架構,提供了完整的查詢引擎和索引引擎。

索引庫:相當於資料庫。

索引:相當於為資料庫建立的目錄。

文件:資料庫中一條記錄的刪減版(索引庫中的乙個索引)。

查詢分為:

(1)基本查詢:按照字段進行查詢

(2)term查詢:查詢條件不可以拆分

(3)模糊/容錯查詢:可設定錯1個字或者2個字進行查詢

(4)萬用字元查詢:

(5)數值範圍查詢:

(6)組合/布林查詢:

高亮顯示:   高亮顯示的主要實現原理在於,為所有的關鍵字新增乙個html標籤,通過該標籤來設定高亮。

使用lucene:

(1)新增的依賴:

lucene核心庫    lucene-core

查詢解析器       lucene-queryparser

預設分詞器      lucene-analyzers-common

ik分詞器        ikanalyzer

高亮顯示        lucene-highlighter

<

dependencies

>

<

dependency

>

<

groupid

>

junit

groupid

>

<

artifactid

>

junit

artifactid

>

<

version

>

4.12

version

>

dependency

>

<

dependency

>

<

groupid

>

org.apache.lucene

groupid

>

<

artifactid

>

lucene

-core

artifactid

>

<

version

>

4.10.2

version

>

dependency

>

<

dependency

>

<

groupid

>

org.apache.lucene

groupid

>

<

artifactid

>

lucene

-queryparser

artifactid

>

<

version

>

4.10.2

version

>

dependency

>

<

dependency

>

<

groupid

>

org.apache.lucene

groupid

>

<

artifactid

>

lucene

-analyzers-common

artifactid

>

<

version

>

4.10.2

version

>

dependency

>

<

dependency

>

<

groupid

>

org.apache.lucene

groupid

>

<

artifactid

>

lucene

-highlighter

artifactid

>

<

version

>

4.10.2

version

>

dependency

>

<

dependency

>

<

groupid

>

com.janeluo

groupid

>

<

artifactid

>

ikanalyzer

artifactid

>

<

version

>

2012_u6

version

>

dependency

>

dependencies

>

(2)建立乙個索引:

@test

public void testcreateindex() throws exception

(3)基本查詢:

public static void main(string args) throws exception

}

(4)高亮顯示:

mysql常用知識點 mysql 常用知識點。

mysql u root p show databases show tables select from abc order by id limit 0,10 create database bbb exit mysqldump u root p game home backup.sql mysq...

shell常用知識點

0 shell中if,while的條件語句怎麼寫 test和 字串比較 數字比較 g,l,e,n,q,t的組合 greater than,less than,equil,not equil,greater equil,less equil 1 shell的字串 str hello str hello...

Oracle常用知識點

oracle的預設賬號及密碼有以下三種 1.使用者名稱 sys密碼 change on install 2.使用者名稱 system密碼 manager 3.使用者名稱 scott密碼 tiger 注意登陸模式不是normal select 分組的列,sum 要求和的列 from 表 group b...