@groupdocs/groupdocs.search 24.6.0
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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>GroupDocs - End User License Agreement (EULA)</title>
|
|
4
|
+
<meta http-equiv="refresh" content="0; url=https://company.groupdocs.com/legal/eula" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<p>Please wait. You'll be redirected to the online version of EULA.</p>
|
|
8
|
+
<p>If it fails to redirect then please go the following link manually: <a href="https://company.groupdocs.com/legal/eula">https://company.groupdocs.com/legal/eula</a></p>
|
|
9
|
+
</body>
|
|
10
|
+
</html>
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
**GroupDocs.Search for Node.js via Java** helps build reliable, smart and feature-rich search application for your end-users, supporting all popular document formats. It extracts text and metadata from different files and performs search over all documents. In order to make search process fast and accurate, index is created and documents are added to it. Hence all the search queries or advanced searches are performed over the index.
|
|
2
|
+
|
|
3
|
+
## Document Indexing Features
|
|
4
|
+
|
|
5
|
+
- 80+ supported file formats.
|
|
6
|
+
- Create index in memory or on disk.
|
|
7
|
+
- Update index to take into account changed, deleted and added documents.
|
|
8
|
+
- Merge several indexes into one.
|
|
9
|
+
- Optimize index to improve search performance.
|
|
10
|
+
- Indexing password protected documents.
|
|
11
|
+
- Indexing with stop words.
|
|
12
|
+
- Support for indexing additional fields.
|
|
13
|
+
- Support for blended characters.
|
|
14
|
+
- Support for characters indexed as a whole word.
|
|
15
|
+
- Support for character replacement during indexing.
|
|
16
|
+
- Support for custom text extractors.
|
|
17
|
+
- Option for compact and metadata index.
|
|
18
|
+
- Ability to save extracted text in index with different level of compression.
|
|
19
|
+
- Document filtering during indexing.
|
|
20
|
+
- Deleting indexed paths from index.
|
|
21
|
+
- Ability to separately extract data from documents and index them.
|
|
22
|
+
- Support for optical text recognition on images.
|
|
23
|
+
- Calculation and indexing of image hashes for reverse image search.
|
|
24
|
+
- The ability to create a distributed search network that automatically balances the load across nodes.
|
|
25
|
+
|
|
26
|
+
## Document Search Features
|
|
27
|
+
|
|
28
|
+
- Simple word search.
|
|
29
|
+
- Boolean search.
|
|
30
|
+
- Regular expression search.
|
|
31
|
+
- Faceted search.
|
|
32
|
+
- Case sensitive search.
|
|
33
|
+
- Flexible fuzzy search.
|
|
34
|
+
- Synonym search.
|
|
35
|
+
- Homophone search.
|
|
36
|
+
- Wildcard search.
|
|
37
|
+
- Phrase search with wildcards.
|
|
38
|
+
- Search for different word forms.
|
|
39
|
+
- Date range search.
|
|
40
|
+
- Numeric range search.
|
|
41
|
+
- Search by chunks (pages).
|
|
42
|
+
- Document filtering in search result.
|
|
43
|
+
- Search for different object types: text, numbers, dates, file names, document types, metadata fields, document creation/modification dates.
|
|
44
|
+
- Combine different types of search into one search query.
|
|
45
|
+
- Alias substitution in search queries.
|
|
46
|
+
- Perform spell check during search.
|
|
47
|
+
- Perform keyboard layout correction during search.
|
|
48
|
+
- Search queries in text or flexible object form.
|
|
49
|
+
- Highlight search results in the text of the entire document or in text segments.
|
|
50
|
+
- Multiple simultaneous thread safe search.
|
|
51
|
+
- Thread safe search during indexing, updating or merging operation.
|
|
52
|
+
- Search over several indexes simultaneously.
|
|
53
|
+
- Built-in support for reverse image search.
|
|
54
|
+
|
|
55
|
+
## Getting Started with GroupDocs.Search for Node.js via Java
|
|
56
|
+
|
|
57
|
+
### Installation
|
|
58
|
+
|
|
59
|
+
From the command line:
|
|
60
|
+
|
|
61
|
+
npm i @groupdocs/groupdocs.search
|
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
(() => {
|
|
5
|
+
function checkFileExists(filePath) {
|
|
6
|
+
try {
|
|
7
|
+
fs.accessSync(filePath, fs.constants.F_OK);
|
|
8
|
+
return true;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (!checkFileExists(path.join(__dirname, 'lib/groupdocs-search-nodejs-24.6.jar'))) {
|
|
15
|
+
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-search-nodejs-24.6.jar not found in the lib directory.\nPlease navigate to the package directory:`);
|
|
16
|
+
console.log('\n cd node_modules/@groupdocs/groupdocs.search\n');
|
|
17
|
+
console.warn('\x1b[33m%s\x1b[0m', `Then download the JAR file using the command:`);
|
|
18
|
+
console.log('\n npm run postinstall\n');
|
|
19
|
+
process.exit(0)
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
module.exports = require("./lib/groupdocs.search");
|
|
23
|
+
}
|
|
24
|
+
})()
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const java = require('java');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
if (os.platform() === 'darwin') {
|
|
6
|
+
java.options.push('-Djava.awt.headless=true');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
java.asyncOptions = {
|
|
10
|
+
asyncSuffix: 'Async',
|
|
11
|
+
syncSuffix: '',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
java.classpath.push(path.join(__dirname, '/groupdocs-search-nodejs-24.6.jar'));
|
|
15
|
+
java.classpath.push(path.join(__dirname, '/aspose-ocr-21.9.jar'));
|
|
16
|
+
java.classpath.push(path.join(__dirname, '/onnxruntime-1.8.1.jar'));
|
|
17
|
+
|
|
18
|
+
exports = module.exports;
|
|
19
|
+
|
|
20
|
+
function __typeof__(objClass) {
|
|
21
|
+
if (objClass !== undefined && objClass.constructor) {
|
|
22
|
+
const strFun = objClass.constructor.toString();
|
|
23
|
+
let className = strFun.substr(0, strFun.indexOf('('));
|
|
24
|
+
className = className.replace('function', '');
|
|
25
|
+
return className.replace(/(^\s*)|(\s*$)/gi, '');
|
|
26
|
+
}
|
|
27
|
+
return typeof objClass;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** STREAM HELPERS * */
|
|
31
|
+
exports.readDataFromStream = function (readStream, callback) {
|
|
32
|
+
const inputStreamBuffer = new exports.StreamBuffer();
|
|
33
|
+
readStream.on('data', (chunk) => {
|
|
34
|
+
inputStreamBuffer.write(chunk);
|
|
35
|
+
});
|
|
36
|
+
readStream.on('end', () => {
|
|
37
|
+
callback(inputStreamBuffer.toInputStream());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.readBytesFromStream = function (readStream, callback) {
|
|
42
|
+
const inputStreamBuffer = new exports.StreamBuffer();
|
|
43
|
+
readStream.on('data', (chunk) => {
|
|
44
|
+
inputStreamBuffer.write(chunk);
|
|
45
|
+
});
|
|
46
|
+
readStream.on('end', () => {
|
|
47
|
+
const array = Array.from(inputStreamBuffer.toByteArray());
|
|
48
|
+
const javaArray = java.newArray('byte', array);
|
|
49
|
+
callback(javaArray);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
(exports.MainBufferMode = {
|
|
54
|
+
AccumulatingSeparators: 0,
|
|
55
|
+
ConstructingTerm: 1,
|
|
56
|
+
SkippingLongTerm: 2,
|
|
57
|
+
}),
|
|
58
|
+
(exports.Extractor = java.import('com.groupdocs.search.Extractor'));
|
|
59
|
+
exports.Index = java.import('com.groupdocs.search.Index');
|
|
60
|
+
exports.IndexRepository = java.import('com.groupdocs.search.IndexRepository');
|
|
61
|
+
exports.IndexSettings = java.import('com.groupdocs.search.IndexSettings');
|
|
62
|
+
exports.IndexUpdater = java.import('com.groupdocs.search.IndexUpdater');
|
|
63
|
+
exports.LicenseRestrictionException = java.import('com.groupdocs.search.LicenseRestrictionException');
|
|
64
|
+
exports.PleaseReportException = java.import('com.groupdocs.search.PleaseReportException');
|
|
65
|
+
exports.SearchDocumentFilter = java.import('com.groupdocs.search.SearchDocumentFilter');
|
|
66
|
+
exports.DocumentFilter = java.import('com.groupdocs.search.DocumentFilter');
|
|
67
|
+
exports.AttributeChangeBatch = java.import('com.groupdocs.search.common.AttributeChangeBatch');
|
|
68
|
+
exports.Cancellation = java.import('com.groupdocs.search.common.Cancellation');
|
|
69
|
+
exports.DocumentField = java.import('com.groupdocs.search.common.DocumentField');
|
|
70
|
+
exports.Encodings = java.import('com.groupdocs.search.common.Encodings');
|
|
71
|
+
exports.ExtractedItemInfo = java.import('com.groupdocs.search.common.ExtractedItemInfo');
|
|
72
|
+
exports.FileLogger = java.import('com.groupdocs.search.common.FileLogger');
|
|
73
|
+
exports.FileOutputAdapter = java.import('com.groupdocs.search.common.FileOutputAdapter');
|
|
74
|
+
exports.StreamOutputAdapter = java.import('com.groupdocs.search.common.StreamOutputAdapter');
|
|
75
|
+
exports.StringOutputAdapter = java.import('com.groupdocs.search.common.StringOutputAdapter');
|
|
76
|
+
exports.StructureOutputAdapter = java.import('com.groupdocs.search.common.StructureOutputAdapter');
|
|
77
|
+
exports.WordPattern = java.import('com.groupdocs.search.common.WordPattern');
|
|
78
|
+
exports.AliasReplacementPair = java.import('com.groupdocs.search.dictionaries.AliasReplacementPair');
|
|
79
|
+
exports.CharacterReplacementPair = java.import('com.groupdocs.search.dictionaries.CharacterReplacementPair');
|
|
80
|
+
exports.EnglishWordFormsProvider = java.import('com.groupdocs.search.dictionaries.EnglishWordFormsProvider');
|
|
81
|
+
exports.EventArgs = java.import('com.groupdocs.search.events.EventArgs');
|
|
82
|
+
exports.DocumentHighlighter = java.import('com.groupdocs.search.highlighters.DocumentHighlighter');
|
|
83
|
+
exports.FragmentHighlighter = java.import('com.groupdocs.search.highlighters.FragmentHighlighter');
|
|
84
|
+
exports.License = java.import('com.groupdocs.search.licenses.License');
|
|
85
|
+
exports.Metered = java.import('com.groupdocs.search.licenses.Metered');
|
|
86
|
+
exports.ChangeAttributesOptions = java.import('com.groupdocs.search.options.ChangeAttributesOptions');
|
|
87
|
+
exports.Color = java.import('com.groupdocs.search.options.Color');
|
|
88
|
+
exports.CommonFieldNames = java.import('com.groupdocs.search.options.CommonFieldNames');
|
|
89
|
+
exports.DateFormat = java.import('com.groupdocs.search.options.DateFormat');
|
|
90
|
+
exports.DeleteOptions = java.import('com.groupdocs.search.options.DeleteOptions');
|
|
91
|
+
exports.EpubFieldNames = java.import('com.groupdocs.search.options.EpubFieldNames');
|
|
92
|
+
exports.ExtractionOptions = java.import('com.groupdocs.search.options.ExtractionOptions');
|
|
93
|
+
exports.FictionBookFieldNames = java.import('com.groupdocs.search.options.FictionBookFieldNames');
|
|
94
|
+
exports.HighlightOptions = java.import('com.groupdocs.search.options.HighlightOptions');
|
|
95
|
+
exports.ImageSearchOptions = java.import('com.groupdocs.search.options.ImageSearchOptions');
|
|
96
|
+
exports.IndexingOptions = java.import('com.groupdocs.search.options.IndexingOptions');
|
|
97
|
+
exports.MailFieldNames = java.import('com.groupdocs.search.options.MailFieldNames');
|
|
98
|
+
exports.MergeOptions = java.import('com.groupdocs.search.options.MergeOptions');
|
|
99
|
+
exports.OcrContext = java.import('com.groupdocs.search.options.OcrContext');
|
|
100
|
+
exports.OptimizeOptions = java.import('com.groupdocs.search.options.OptimizeOptions');
|
|
101
|
+
exports.PresentationFieldNames = java.import('com.groupdocs.search.options.PresentationFieldNames');
|
|
102
|
+
exports.SearchOptions = java.import('com.groupdocs.search.options.SearchOptions');
|
|
103
|
+
exports.SimilarityLevel = java.import('com.groupdocs.search.options.SimilarityLevel');
|
|
104
|
+
exports.SpreadsheetFieldNames = java.import('com.groupdocs.search.options.SpreadsheetFieldNames');
|
|
105
|
+
exports.Step = java.import('com.groupdocs.search.options.Step');
|
|
106
|
+
exports.SynchronizeOptions = java.import('com.groupdocs.search.options.SynchronizeOptions');
|
|
107
|
+
exports.TableDiscreteFunction = java.import('com.groupdocs.search.options.TableDiscreteFunction');
|
|
108
|
+
exports.TextOptions = java.import('com.groupdocs.search.options.TextOptions');
|
|
109
|
+
exports.TextStorageSettings = java.import('com.groupdocs.search.options.TextStorageSettings');
|
|
110
|
+
exports.UpdateOptions = java.import('com.groupdocs.search.options.UpdateOptions');
|
|
111
|
+
exports.WordsFieldNames = java.import('com.groupdocs.search.options.WordsFieldNames');
|
|
112
|
+
exports.SearchNetworkNode = java.import('com.groupdocs.search.scaling.SearchNetworkNode');
|
|
113
|
+
exports.Configurator = java.import('com.groupdocs.search.scaling.configuring.Configurator');
|
|
114
|
+
exports.TcpSettings = java.import('com.groupdocs.search.scaling.configuring.TcpSettings');
|
|
115
|
+
|
|
116
|
+
exports.Document = java.import('com.groupdocs.search.Document');
|
|
117
|
+
exports.ExtractedData = java.import('com.groupdocs.search.ExtractedData');
|
|
118
|
+
exports.SearchQuery = java.import('com.groupdocs.search.SearchQuery');
|
|
119
|
+
exports.DocumentSourceKind = java.import('com.groupdocs.search.common.DocumentSourceKind');
|
|
120
|
+
exports.DocumentStatus = java.import('com.groupdocs.search.common.DocumentStatus');
|
|
121
|
+
exports.IndexStatus = java.import('com.groupdocs.search.common.IndexStatus');
|
|
122
|
+
exports.VersionUpdateResult = java.import('com.groupdocs.search.common.VersionUpdateResult');
|
|
123
|
+
exports.SearchImage = java.import('com.groupdocs.search.common.SearchImage');
|
|
124
|
+
exports.CharacterType = java.import('com.groupdocs.search.dictionaries.CharacterType');
|
|
125
|
+
exports.DictionaryType = java.import('com.groupdocs.search.dictionaries.DictionaryType');
|
|
126
|
+
exports.OperationType = java.import('com.groupdocs.search.events.OperationType');
|
|
127
|
+
exports.SearchPhase = java.import('com.groupdocs.search.events.SearchPhase');
|
|
128
|
+
exports.Compression = java.import('com.groupdocs.search.options.Compression');
|
|
129
|
+
exports.ImageLocation = java.import('com.groupdocs.search.options.ImageLocation');
|
|
130
|
+
exports.IndexType = java.import('com.groupdocs.search.options.IndexType');
|
|
131
|
+
exports.NumberOfThreads = java.import('com.groupdocs.search.options.NumberOfThreads');
|
|
132
|
+
exports.OutputFormat = java.import('com.groupdocs.search.options.OutputFormat');
|
|
133
|
+
exports.FileType = java.import('com.groupdocs.search.results.FileType');
|
|
134
|
+
exports.SearchNetworkStatus = java.import('com.groupdocs.search.scaling.SearchNetworkStatus');
|
|
135
|
+
|
|
136
|
+
exports.AsposeOcr = java.import('com.aspose.ocr.AsposeOCR');
|
|
137
|
+
|
|
138
|
+
exports.StreamBuffer = class StreamBuffer {
|
|
139
|
+
constructor() {
|
|
140
|
+
const self = java.newInstanceSync('com.groupdocs.search.contracts.StreamBuffer');
|
|
141
|
+
|
|
142
|
+
self.write = function (chunk) {
|
|
143
|
+
const array = Array.from(chunk);
|
|
144
|
+
const javaArray = java.newArray('byte', array);
|
|
145
|
+
self.__proto__.write.call(self, javaArray, 0, javaArray.length);
|
|
146
|
+
};
|
|
147
|
+
return self;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** STREAM METHODS * */
|
|
152
|
+
exports.License.setLicenseFromStream = function (license, licenseStream, callback) {
|
|
153
|
+
const inputStreamBuffer = new exports.StreamBuffer();
|
|
154
|
+
licenseStream.on('data', (chunk) => {
|
|
155
|
+
inputStreamBuffer.write(chunk);
|
|
156
|
+
});
|
|
157
|
+
licenseStream.on('end', () => {
|
|
158
|
+
let error;
|
|
159
|
+
try {
|
|
160
|
+
license.setLicense(inputStreamBuffer.toInputStream());
|
|
161
|
+
} catch (err) {
|
|
162
|
+
error = err;
|
|
163
|
+
}
|
|
164
|
+
callback(error);
|
|
165
|
+
});
|
|
166
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@groupdocs/groupdocs.search",
|
|
3
|
+
"version": "24.6.0",
|
|
4
|
+
"description": "Powerful full-text search engine for PDF, Word, Excel, PowerPoint and image files.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "curl -H 'Cache-Control:no-cache' https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-search-nodejs/24.6/groupdocs-search-nodejs-24.6.jar > lib/groupdocs-search-nodejs-24.6.jar"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"PDF",
|
|
11
|
+
"Word",
|
|
12
|
+
"DOCX",
|
|
13
|
+
"DOC",
|
|
14
|
+
"PowerPoint",
|
|
15
|
+
"PPT",
|
|
16
|
+
"PPTX",
|
|
17
|
+
"Excel",
|
|
18
|
+
"XLS",
|
|
19
|
+
"XLSX",
|
|
20
|
+
"CSV",
|
|
21
|
+
"to",
|
|
22
|
+
"JPG",
|
|
23
|
+
"PNG",
|
|
24
|
+
"Spreadsheet",
|
|
25
|
+
"SVG"
|
|
26
|
+
],
|
|
27
|
+
"author": "Aspose",
|
|
28
|
+
"license": "End User License Agreement.html",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"java": "^0.13.0"
|
|
31
|
+
},
|
|
32
|
+
"directories": {
|
|
33
|
+
"lib": "lib"
|
|
34
|
+
}
|
|
35
|
+
}
|