gs-search 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.d.ts +5 -5
- package/lib/simple.d.ts +5 -5
- package/lib/type.cjs +0 -2
- package/lib/type.d.ts +5 -7
- package/lib/type.js +1 -1
- package/package.json +1 -1
package/lib/core.d.ts
CHANGED
|
@@ -16,19 +16,19 @@ declare class SearchEngine implements ISearchEngine {
|
|
|
16
16
|
* 触发索引构建检查并保存元数据
|
|
17
17
|
*/
|
|
18
18
|
endBatch(): Promise<void>;
|
|
19
|
-
addDocument
|
|
19
|
+
addDocument(doc: IDocument): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* 添加单个文档,如果文档ID已存在则跳过
|
|
22
22
|
* 用于在批量添加中途出错后的恢复添加行为,也可直接用于单个文档添加
|
|
23
23
|
*/
|
|
24
|
-
addDocumentIfMissing
|
|
24
|
+
addDocumentIfMissing(doc: IDocument): Promise<void>;
|
|
25
25
|
/**
|
|
26
26
|
* 添加多个文档,跳过已存在的文档ID
|
|
27
27
|
* 用于在批量添加中途出错后的恢复添加行为,也可直接用于批量添加
|
|
28
28
|
*/
|
|
29
|
-
addDocumentsIfMissing
|
|
30
|
-
addDocuments
|
|
31
|
-
search
|
|
29
|
+
addDocumentsIfMissing(docs: IDocument[]): Promise<void>;
|
|
30
|
+
addDocuments(docs: IDocument[]): Promise<void>;
|
|
31
|
+
search(query: IDocumentBase | string, limit?: number): Promise<IResult[]>;
|
|
32
32
|
removeDocument(id: number): Promise<void>;
|
|
33
33
|
clearAll(): Promise<void>;
|
|
34
34
|
getStatus(): Promise<ISearchEngineStatus>;
|
package/lib/simple.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ declare class SimpleSearch {
|
|
|
14
14
|
static configure(config: Partial<ISearchEngineOption>): void;
|
|
15
15
|
static startBatch(): Promise<void>;
|
|
16
16
|
static endBatch(): Promise<void>;
|
|
17
|
-
static addDocument
|
|
18
|
-
static addDocumentIfMissing
|
|
19
|
-
static addDocuments
|
|
20
|
-
static addDocumentsIfMissing
|
|
21
|
-
static search
|
|
17
|
+
static addDocument(doc: IDocument): Promise<void>;
|
|
18
|
+
static addDocumentIfMissing(doc: IDocument): Promise<void>;
|
|
19
|
+
static addDocuments(docs: IDocument[]): Promise<void>;
|
|
20
|
+
static addDocumentsIfMissing(docs: IDocument[]): Promise<void>;
|
|
21
|
+
static search(query: IDocumentBase | string, limit?: number): Promise<___type.IResult[]>;
|
|
22
22
|
static removeDocument(id: number): Promise<void>;
|
|
23
23
|
static clearAll(): Promise<void>;
|
|
24
24
|
static getStatus(): Promise<___type.ISearchEngineStatus>;
|
package/lib/type.cjs
CHANGED
package/lib/type.d.ts
CHANGED
|
@@ -149,19 +149,19 @@ interface ISearchEngine {
|
|
|
149
149
|
* 触发索引构建检查并保存元数据
|
|
150
150
|
*/
|
|
151
151
|
endBatch(): Promise<void>;
|
|
152
|
-
addDocument
|
|
152
|
+
addDocument(doc: IDocument): Promise<void>;
|
|
153
153
|
/**
|
|
154
154
|
* 添加单个文档,如果文档ID已存在则跳过
|
|
155
155
|
* 用于在批量添加中途出错后的恢复添加行为,也可直接用于单个文档添加
|
|
156
156
|
*/
|
|
157
|
-
addDocumentIfMissing
|
|
157
|
+
addDocumentIfMissing(doc: IDocument): Promise<void>;
|
|
158
158
|
/**
|
|
159
159
|
* 添加多个文档,跳过已存在的文档ID
|
|
160
160
|
* 用于在批量添加中途出错后的恢复添加行为,也可直接用于批量添加
|
|
161
161
|
*/
|
|
162
|
-
addDocumentsIfMissing
|
|
163
|
-
addDocuments
|
|
164
|
-
search
|
|
162
|
+
addDocumentsIfMissing(docs: IDocument[]): Promise<void>;
|
|
163
|
+
addDocuments(docs: IDocument[]): Promise<void>;
|
|
164
|
+
search(query: IDocumentBase | string, limit?: number): Promise<IResult[]>;
|
|
165
165
|
removeDocument(id: number): Promise<void>;
|
|
166
166
|
clearAll(): Promise<void>;
|
|
167
167
|
getStatus(): Promise<ISearchEngineStatus>;
|
|
@@ -173,6 +173,4 @@ interface ISearchEngine {
|
|
|
173
173
|
hasDocument(id: number): Promise<boolean>;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
|
|
177
|
-
|
|
178
176
|
export type { IDocument, IDocumentBase, IIndexMeta, IResult, ISearchEngine, ISearchEngineOption, ISearchEngineStatus, ISegmentMeta, IStorage, ITokenizedDoc, IndexType, IndexingTokenizer, SearchTokenizer };
|
package/lib/type.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|