Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
6f56b7de
提交
6f56b7de
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation.
上级
e3c38968
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
1422 行增加
和
1408 行删除
+1422
-1408
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+463
-457
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+463
-457
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+460
-458
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+34
-34
help.csv
h2/src/main/org/h2/res/help.csv
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
6f56b7de
This diff is collapsed.
Click to expand it.
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
6f56b7de
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
6f56b7de
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
6f56b7de
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
6f56b7de
...
...
@@ -39,11 +39,11 @@ import org.h2.util.New;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
//## Java 1.4 end ##
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
import
org.apache.lucene.index.IndexModifier
;
import
org.apache.lucene.search.Hits
;
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
import java.io.File;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
...
...
@@ -51,7 +51,7 @@ import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Version;
import org.apache.lucene.index.IndexWriter;
//## LUCENE3 end ##
## LUCENE3 end ##*/
/**
* This class implements the full text search based on Apache Lucene.
...
...
@@ -268,13 +268,13 @@ public class FullTextLucene extends FullText {
IndexAccess
access
=
INDEX_ACCESS
.
get
(
path
);
if
(
access
==
null
)
{
try
{
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
boolean
recreate
=
!
IndexReader
.
indexExists
(
path
);
Analyzer
analyzer
=
new
StandardAnalyzer
();
access
=
new
IndexAccess
();
access
.
modifier
=
new
IndexModifier
(
path
,
analyzer
,
recreate
);
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
File f = new File(path);
Directory indexDir = FSDirectory.open(f);
boolean recreate = !IndexReader.indexExists(indexDir);
...
...
@@ -287,7 +287,7 @@ public class FullTextLucene extends FullText {
access.writer = writer;
access.reader = reader;
access.searcher = new IndexSearcher(reader);
//## LUCENE3 end ##
## LUCENE3 end ##*/
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -361,15 +361,15 @@ public class FullTextLucene extends FullText {
synchronized
(
INDEX_ACCESS
)
{
try
{
INDEX_ACCESS
.
remove
(
indexPath
);
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
access
.
modifier
.
flush
();
access
.
modifier
.
close
();
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
access.searcher.close();
access.reader.close();
access.writer.close();
//## LUCENE3 end ##
## LUCENE3 end ##*/
}
catch
(
Exception
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -397,7 +397,7 @@ public class FullTextLucene extends FullText {
}
try
{
IndexAccess
access
=
getIndexAccess
(
conn
);
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
access
.
modifier
.
flush
();
String
path
=
getIndexPath
(
conn
);
IndexReader
reader
=
IndexReader
.
open
(
path
);
...
...
@@ -413,8 +413,8 @@ public class FullTextLucene extends FullText {
for
(
int
i
=
0
;
i
<
limit
&&
i
+
offset
<
max
;
i
++)
{
Document
doc
=
hits
.
doc
(
i
+
offset
);
float
score
=
hits
.
score
(
i
+
offset
);
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
// take a reference as the searcher may change
Searcher searcher = access.searcher;
// reuse the same analyzer; it's thread-safe;
...
...
@@ -438,7 +438,7 @@ public class FullTextLucene extends FullText {
ScoreDoc sd = docs.scoreDocs[i + offset];
Document doc = searcher.doc(sd.doc);
float score = sd.score;
//## LUCENE3 end ##
## LUCENE3 end ##*/
String
q
=
doc
.
get
(
LUCENE_FIELD_QUERY
);
if
(
data
)
{
int
idx
=
q
.
indexOf
(
" WHERE "
);
...
...
@@ -461,10 +461,10 @@ public class FullTextLucene extends FullText {
result
.
addRow
(
q
,
score
);
}
}
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
// TODO keep it open if possible
reader
.
close
();
## LUCENE2 end ##*/
//## LUCENE2 end ##
}
catch
(
Exception
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -607,7 +607,7 @@ public class FullTextLucene extends FullText {
* @param row the row
*/
protected
void
insert
(
Object
[]
row
)
throws
SQLException
{
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
String
query
=
getQuery
(
row
);
Document
doc
=
new
Document
();
doc
.
add
(
new
Field
(
LUCENE_FIELD_QUERY
,
query
,
...
...
@@ -639,8 +639,8 @@ public class FullTextLucene extends FullText {
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
String query = getQuery(row);
Document doc = new Document();
doc.add(new Field(LUCENE_FIELD_QUERY, query,
...
...
@@ -680,7 +680,7 @@ public class FullTextLucene extends FullText {
} catch (IOException e) {
throw convertException(e);
}
//## LUCENE3 end ##
## LUCENE3 end ##*/
}
/**
...
...
@@ -692,12 +692,12 @@ public class FullTextLucene extends FullText {
String
query
=
getQuery
(
row
);
try
{
Term
term
=
new
Term
(
LUCENE_FIELD_QUERY
,
query
);
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
indexAccess
.
modifier
.
deleteDocuments
(
term
);
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
indexAccess.writer.deleteDocuments(term);
//## LUCENE3 end ##
## LUCENE3 end ##*/
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -731,30 +731,30 @@ public class FullTextLucene extends FullText {
/**
* The index modified.
*/
/
*
## LUCENE2 begin ##
/
/
## LUCENE2 begin ##
IndexModifier
modifier
;
## LUCENE2 end ##*/
//## LUCENE2 end ##
/**
* The index writer.
*/
/
/
## LUCENE3 begin ##
/
*
## LUCENE3 begin ##
IndexWriter writer;
//## LUCENE3 end ##
## LUCENE3 end ##*/
/**
* The index reader.
*/
/
/
## LUCENE3 begin ##
/
*
## LUCENE3 begin ##
IndexReader reader;
//## LUCENE3 end ##
## LUCENE3 end ##*/
/**
* The index searcher.
*/
/
/
## LUCENE3 begin ##
/
*
## LUCENE3 begin ##
Searcher searcher;
//## LUCENE3 end ##
## LUCENE3 end ##*/
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/res/help.csv
浏览文件 @
6f56b7de
...
...
@@ -14,7 +14,7 @@ FROM tableExpression [,...] [ WHERE expression ]
Selects data from a table or multiple tables."
"Commands (DML)","INSERT","
INSERT INTO tableName [ ( columnName [,...] ) ]
{ VALUES { ( { DEFAULT | expression } [,...] ) } [,...] | select }
{ VALUES { ( { DEFAULT | expression } [,...] ) } [,...] |
[ DIRECT ] [ SORTED ]
select }
","
Inserts a new row / new rows into a table."
"Commands (DML)","UPDATE","
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论