question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Searching words with ending wildcards returns inconsistent results

See original GitHub issue

For example, on https://olivernn.github.io/moonwalkers/, both pilot and pilot* will return the results I expect. However, module* returns nothing (while module works as I expect).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
olivernncommented, Oct 27, 2017

@larskendall without seeing how you set up your index its difficult to say for sure, but that looks like the result of stemming. “critical” stems to “critic” you can test this out with the following snippet:

idx.pipeline.runString("critical")

Further up in this thread there are a couple of suggestions for ways to express searches that will lead to the kind of results it seems you are expecting. An alternative is to disable the stemmer at build time and search time:

var idx = lunr(function() {
  //...snip...
  this.pipeline.remove(lunr.stemmer)
  this.searchPipeline.remove(lunr.stemmer)
  //...snip...
  // add documents here
})
4reactions
olivernncommented, Apr 24, 2017

I’ve pushed a change that should fix the “duplicate index” error, please try version 2.0.3 and let me know if there are any issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Searching: Truncation, Wildcards and Proximity
In this example, your search will return results with the terms debt and forgiveness within ten words of each other.
Read more >
Truncation & Wildcards - Database Search Tips
Truncation, also called stemming, allows you to search for all variations of a word with multiple endings. It uses the root word followed...
Read more >
Truncation - Database Search Tips - LibGuides
The database will return results that include any ending of that root word. It is useful when searching for words with multiple endings....
Read more >
Truncation - Database Search Tips - LibGuides at MIT Libraries
About truncation and wildcards · To use truncation, enter the root of a word and put the truncation symbol at the end. ·...
Read more >
Finding and replacing characters using wildcards
(Unfortunately, there is no wildcard to search for “zero or more occurrences” in Word wildcard searches; [!^13]{0,} does not work). 8. ( )....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found