🔎 .NET Core cross-platform, in-memory, full text search library for building search engines. Made to learn C#.
.NET Core cross-platform, in-memory, full text search library for building search engines
Coresearch uses an inverted index with a boosted trie data structure for indexing atomic search criterion from content to resources. Trie algorithm makes Coresearch more elastic and allows both exact word querying and operations like fuzzy search, wildcards and character matching. Entire trie structure is stored in memory for better performance. The entire project was written as a learning project so be aware of putting in on the production 😉
source <string path> <string extension>
alias: load
example:
> source ./ *.txt
get <string key>
alias: search
example:
> search cars
output:
<resource names for key cars>
Query modes:
query <string prefix> <query mode: . or *>
example 1:
> query c ?
output:
<resource names for keys: ca, cb, c5, co, c1, ...>
example 2:
> query c *
output:
<resource names for keys: ca, cabbage, c4a541, cars, cardio, cantaloupe, ...>
example 3:
> query cars
output:
<resource names for key cars>
add <string resource name> <string content>
alias: insert
example:
> add english-dict.txt house
delete <string key>
example:
> delete sport
echo <string content>
example:
> echo hello
output:
hello
debug <bool>
example:
> debug true
flush
example:
> flush
info
example:
> flush
output:
Nodes in trie: 4651175
Words inserted: 15513389
Resource files: 2227
Memory usage: 1044944640 bytes
clear
example:
> clear
Turn debug mode
--debug <bool>
-d
Set max size of memory (in bytes)
--memory-limit <int>
-m
Pre-process every word before insert
--normalize <bool>
-n
Pattern for removing unwanted characters, used for each word before insert
--pattern <regex>
-p
Load data from specific path at start
--source <string>
-s
Set extension for loading data at start
--extension <string>
-e
coresearch is licensed under the MIT.