0.1.0 • Published 5 months ago

@stereobooster/facets v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Facets

Facets is a client-side (though you can run it on the server) faceted search engine.

Facet - any of the definable aspects that make up a subject (as of contemplation) or an object (as of consideration)

Facets main purpose is to do the faceting aspect of the search. Text search is outsourced to other libraries, for example, you can use:

The main secret ingredient is TypedFastBitSet.js - a fast set data structure. Using it and standard Map allows us to build an inverted-index data structure. From there, it's a pretty straightforward implementation.

Demo

It is easier to show than explain. See online demo here.

Is it ready for production?

The demo works, as you can see, but beyond that, there was no exhaustive testing. There are still rough edges. API can change.

TODO

  • default values for facet by type
    • number
      • sort by value asc
      • showZeroes=false
  • initialization
  • memoization
  • ​maxValuesPerFacet
  • facets: "price"
  • numeric filter
    • support > (not just >=), < (not just <=)
    • support multiple ranges e.g [{ from, to }, { eq }, { neq }]
  • more tests
  • errors and warnings, for example
    • warn if people try to use text search without providing text index
  • benchmarks
    • performance seems to be good (except numeric range filter), but in order to be sure we need to do benchmark
  • benchmark memory