Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
bulksearch
Advanced tools
Searching full text with BulkSearch is up to 1,000 times faster than ElasticSearch implementation.
Benchmark Comparison: https://jsperf.com/bulksearch
All Features:
Plugins In Progress:
npm install bulksearch
In your code include as follows:
var BulkSearch = require("BulkSearch");
<html>
<head>
<script src="https://cdn.rawgit.com/nextapps-de/bulksearch/master/bulksearch.min.js"></script>
</head>
...
AMD
var BulkSearch = require("BulkSearch");
var index = new BulkSearch();
alternatively you can also use:
var index = BulkSearch.create();
BulkSearch.create(options)
var index = new BulkSearch({
// default values:
type: "integer",
encode: "icase",
boolean: "and",
strict: false,
ordered: false,
multi: false,
cache: false
});
Read more: Phonetic Search, Phonetic Comparison, Improve Memory Usage
Index.add_(id, string)
index.add(10025, "John Doe");
Index.search(string, limit, callback)
index.search("John");
index.search("John", 10);
index.search("John", function(result){
// array of results
});
Index.update(id, string)
index.update(10025, "Road Runner");
Index.remove(id)
index.remove(10025);
index.destroy();
Index.init(options)
index.init();
Index.addMatcher(KEY_VALUE_PAIRS)
index.addMatcher({
'ä': 'a', // replaces all 'ä' to 'a'
'ö': 'o',
'Ü': 'u'
});
var index = new BulkSearch({
encode: function(str){
// do something with str ...
return str;
}
});
index.info();
Returns information about the index, e.g.:
{
"bytes": 3600356288,
"chunks": 9,
"fragmentation": 0,
"fragments": 0,
"id": 0,
"length": 7798,
"matchers": 0,
"size": 10000,
"status": false
}
Note: When the fragmentation value is about 50% or higher, your should consider using cleanup() to free all fragmented available memory.
index.cleanup();
Option | Description | Example |
---|---|---|
false | Turn off encoding |
Reference: "Björn-Phillipp Mayer" Matches: "Phil" |
icase | Case in-sensitive encoding |
Reference: "Björn-Phillipp Mayer" Matches: "phil" |
simple | Phonetic normalizations |
Reference: "Björn-Phillipp Mayer" Matches: "bjoern fillip" |
advanced | Phonetic normalizations + transformations |
Reference: "Björn-Phillipp Mayer" Matches: "filip meier" |
Reference String: "Björn-Phillipp Mayer"
Query | ElasticSearch | BulkSearch (iCase) | BulkSearch (Simple) | BulkSearch (Adv.) |
---|---|---|---|---|
björn | yes | yes | yes | yes |
björ | no | yes | yes | yes |
bjorn | no | no | yes | yes |
bjoern | no | no | no | yes |
philipp | no | no | no | yes |
filip | no | no | no | yes |
björnphillip | no | no | yes | yes |
meier | no | no | no | yes |
björn meier | no | no | no | yes |
meier filip | no | no | no | yes |
Note: The data type of passed IDs has to be specified on creation. It is recommended to uses to most lowest possible data range here, e.g. use "short" when IDs are not higher than 65,535.
ID Type | Range of Values | Memory Usage of every ~ 100,000 Words |
---|---|---|
Byte | 0 - 255 | 683 kb + 1.3 Mb |
Short | 0 - 65,535 | 1.3 Mb + 1.3 Mb |
Integer | 0 - 4,294,967,295 | 2.7 Mb + 1.3 Mb |
Float | 0 - * (16 digits) | 5.3 Mb + 1.3 Mb |
String | * (unlimited) | 1.3 Mb * char count of IDs + 1.3 Mb |
The required RAM per instance can be calculated as follow:
BYTES = CONTENT_CHAR_COUNT * (BYTES_OF_ID + 2)
Character count may be less related to the phonetic settings (e.g. when using soundex).
Author BulkSearch: Thomas Wilkerling
License: Apache 2.0 License
FAQs
Superfast, lightweight and read-write optimized full text search library.
We found that bulksearch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.