#search-engine #attributes #matcher #rows #different #generic #sets

attribute-search-engine

Generic search engine for rows with attributes using different matchers

2 unstable releases

0.2.0 Jan 4, 2025
0.1.0 Dec 25, 2024

#82 in Database implementations

Download history 161/week @ 2024-12-24 143/week @ 2024-12-31 17/week @ 2025-01-07

321 downloads per month

MIT license

16KB
324 lines

Attribute Search Engine

github crates.io docs.rs

Attribute Search Engine is a generic search engine for rows consisting of attributes, that can be searched using different matchers.

Warning: This project is not finished yet and the public interface may change.

  • Rows
    • Attributes
      • ExactMatch (HashMap)
      • PrefixMatch (PrefixTree/Trie) (Strings only)
      • RangeMatch (BTreeMap)
  • Queries
    • Are in CNF (Conjunctive Normal Form) Example: +name:Hans,Peter +age:25-35 -lastname=Doe Means: (name=Hans || name==Peter) && (age >= 25 && age <= 35) && !(lastname=Doe)
      1. get a set for each predicate
      2. get the union of these sets for each disjunction
      3. get the intersections of the resulting sets for each conjunction if the result is empty at some point you can short-circuit and stop
      4. get the difference of the conjunction result with all negated conjunctions if the result is empty at some point you can short-circuit and stop
      5. optionally perform a fulltext search

Dependencies

~5.5MB
~83K SLoC