Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-term support to Query#term #341

Closed
wants to merge 1 commit into from
Closed

Conversation

olivernn
Copy link
Owner

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:

  • Lists of terms are supported
  • A term can be anything that responds to toString

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

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:

* Lists of terms are supported
* A term can be anything that responds to `toString`

Together these two changes make it possible to directly use the
lunr.tokenizer when passing strings to Query#term.
@olivernn
Copy link
Owner Author

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

@olivernn olivernn closed this Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant