olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.89k stars 545 forks source link

Add multi-term support to Query#term #341

Closed olivernn closed 6 years ago

olivernn commented 6 years ago

Previously a single term could be passed to the Query#term method, additionally this term needed to be a string. No tokenization is performed by this method. The API was a bit cumbersome when dealing with user entered queries, tokenization had to be done manually, and then the results manually iterated over and used with Query#term.

This change improves matters in two ways:

Together these two changes make it possible to directly use the lunr.tokenizer when passing strings to Query#term.

olivernn commented 6 years ago

This has now been merged into master and is released in version 2.2.0