Skip to content

Repository files navigation

Searchbox

🌐 stuchl4n3k.net | 💻 stuchl4n3k | 🐦 @stuchl4n3k

Text input augmented with Lexer magic✨ to support advanced search features. Searchbox supports multiple user-defined keywords (filters, variables) and also NOT operator.

Features

  • Parses user input string into a structured formula of literals.
  • Supports literal negation.
  • Supports unicode.
  • Operators are configurable.

Usage

import*assearchboxfrom'@webkitty/searchbox';constinputText='Never take title:raisins from -author:rabbits';constkeywords=['title','author'];constformula=searchbox.parse(inputText,{keywords});// Formula:// _: [Never,take,from]	// words not matching any keyword (aka fulltext)// title: [raisins] // "title" keyword match// -author: [rabbits] // "author" keyword match with NOT operator ("-")

Please note that only case-sensitive keyword matching is supported.

📝 License

Copyright © 2019 stuchl4n3k. This project is MIT licensed.

FOSSA Status

About

Text input augmented with Lexer magic✨ to support advanced search features.

Topics

Resources

Stars

7 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages