Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e1a91d29
提交
e1a91d29
authored
7月 23, 2017
作者:
andrei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
full_text_mt
上级
a24af894
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
354 行增加
和
248 行删除
+354
-248
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+180
-113
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+158
-119
FullTextSettings.java
h2/src/main/org/h2/fulltext/FullTextSettings.java
+13
-11
TestFullText.java
h2/src/test/org/h2/test/db/TestFullText.java
+3
-5
没有找到文件。
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
e1a91d29
差异被折叠。
点击展开。
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
e1a91d29
差异被折叠。
点击展开。
h2/src/main/org/h2/fulltext/FullTextSettings.java
浏览文件 @
e1a91d29
...
@@ -10,20 +10,22 @@ import java.sql.PreparedStatement;
...
@@ -10,20 +10,22 @@ import java.sql.PreparedStatement;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.HashMap
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.util.SoftHashMap
;
import
org.h2.util.SoftHashMap
;
/**
/**
* The global settings of a full text search.
* The global settings of a full text search.
*/
*/
class
FullTextSettings
{
final
class
FullTextSettings
{
/**
/**
* The settings of open indexes.
* The settings of open indexes.
*/
*/
private
static
final
HashMap
<
String
,
FullTextSettings
>
SETTINGS
=
New
.
hashMap
(
);
private
static
final
Map
<
String
,
FullTextSettings
>
SETTINGS
=
Collections
.
synchronizedMap
(
New
.<
String
,
FullTextSettings
>
hashMap
()
);
/**
/**
* Whether this instance has been initialized.
* Whether this instance has been initialized.
...
@@ -33,17 +35,17 @@ class FullTextSettings {
...
@@ -33,17 +35,17 @@ class FullTextSettings {
/**
/**
* The set of words not to index (stop words).
* The set of words not to index (stop words).
*/
*/
private
final
HashSet
<
String
>
ignoreList
=
New
.
hashSet
(
);
private
final
Set
<
String
>
ignoreList
=
Collections
.
synchronizedSet
(
New
.<
String
>
hashSet
()
);
/**
/**
* The set of words / terms.
* The set of words / terms.
*/
*/
private
final
HashMap
<
String
,
Integer
>
words
=
New
.
hashMap
(
);
private
final
Map
<
String
,
Integer
>
words
=
Collections
.
synchronizedMap
(
New
.<
String
,
Integer
>
hashMap
()
);
/**
/**
* The set of indexes in this database.
* The set of indexes in this database.
*/
*/
private
final
HashMap
<
Integer
,
IndexInfo
>
indexes
=
New
.
hashMap
(
);
private
final
Map
<
Integer
,
IndexInfo
>
indexes
=
Collections
.
synchronizedMap
(
New
.<
Integer
,
IndexInfo
>
hashMap
()
);
/**
/**
* The prepared statement cache.
* The prepared statement cache.
...
@@ -60,7 +62,7 @@ class FullTextSettings {
...
@@ -60,7 +62,7 @@ class FullTextSettings {
/**
/**
* Create a new instance.
* Create a new instance.
*/
*/
pr
otected
FullTextSettings
()
{
pr
ivate
FullTextSettings
()
{
// don't allow construction
// don't allow construction
}
}
...
@@ -69,7 +71,7 @@ class FullTextSettings {
...
@@ -69,7 +71,7 @@ class FullTextSettings {
*
*
* @return the ignore list
* @return the ignore list
*/
*/
protected
Hash
Set
<
String
>
getIgnoreList
()
{
protected
Set
<
String
>
getIgnoreList
()
{
return
ignoreList
;
return
ignoreList
;
}
}
...
@@ -78,7 +80,7 @@ class FullTextSettings {
...
@@ -78,7 +80,7 @@ class FullTextSettings {
*
*
* @return the word list
* @return the word list
*/
*/
protected
Hash
Map
<
String
,
Integer
>
getWordList
()
{
protected
Map
<
String
,
Integer
>
getWordList
()
{
return
words
;
return
words
;
}
}
...
@@ -140,7 +142,7 @@ class FullTextSettings {
...
@@ -140,7 +142,7 @@ class FullTextSettings {
* @param conn the connection
* @param conn the connection
* @return the file system path
* @return the file system path
*/
*/
pr
otected
static
String
getIndexPath
(
Connection
conn
)
throws
SQLException
{
pr
ivate
static
String
getIndexPath
(
Connection
conn
)
throws
SQLException
{
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
ResultSet
rs
=
stat
.
executeQuery
(
ResultSet
rs
=
stat
.
executeQuery
(
"CALL IFNULL(DATABASE_PATH(), 'MEM:' || DATABASE())"
);
"CALL IFNULL(DATABASE_PATH(), 'MEM:' || DATABASE())"
);
...
...
h2/src/test/org/h2/test/db/TestFullText.java
浏览文件 @
e1a91d29
...
@@ -50,10 +50,6 @@ public class TestFullText extends TestBase {
...
@@ -50,10 +50,6 @@ public class TestFullText extends TestBase {
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
if
(
config
.
multiThreaded
)
{
// It is even mentioned in the docs that this is not supported
return
;
}
testUuidPrimaryKey
(
false
);
testUuidPrimaryKey
(
false
);
testAutoAnalyze
();
testAutoAnalyze
();
testNativeFeatures
();
testNativeFeatures
();
...
@@ -71,7 +67,9 @@ public class TestFullText extends TestBase {
...
@@ -71,7 +67,9 @@ public class TestFullText extends TestBase {
testCreateDropLucene
();
testCreateDropLucene
();
testUuidPrimaryKey
(
true
);
testUuidPrimaryKey
(
true
);
testMultiThreaded
(
true
);
testMultiThreaded
(
true
);
if
(
config
.
mvStore
||
!
config
.
multiThreaded
)
{
testMultiThreaded
(
false
);
testMultiThreaded
(
false
);
}
testTransaction
(
true
);
testTransaction
(
true
);
test
(
true
,
"VARCHAR"
);
test
(
true
,
"VARCHAR"
);
test
(
true
,
"CLOB"
);
test
(
true
,
"CLOB"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论