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.

Search hangs when searching a repeated substring with wildcard

See original GitHub issue

See the jsFiddle here: https://jsfiddle.net/bwe0f44g/

var idx = lunr(function () {
  this.ref('name')
  this.field('text')
  this.add({
  "name": "long",
  "text": "Zlah_testZlah_Zlah_testZlah_testZlah_testZlah_testZlah_testZlah_testZlah_testZlah_testZlah"
});
})

window.search = function search(){
	var t0 = performance.now();
  var result = idx.search('*Zlah*');
  var t1 = performance.now();
  alert('Found '+result.length+' results in ' + (t1-t0) + 'ms');
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
meltuhamycommented, Jun 5, 2017

Yes it seems that is quite a nasty bug that is preventing me from using wildcards. Thanks for your help!

0reactions
meltuhamycommented, Sep 24, 2018

Confirmed this fixes it. Thanks @olivernn !

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql - The string I am searching for begins and ends with a ...
The string I am searching for begins and ends with a wildcard character [duplicate] ... Yes but that did not pop up in...
Read more >
String matching where one string contains wildcard ...
Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns ......
Read more >
Wildcard characters allow searching for patterns and ...
You can use wildcard characters anywhere in a search string, and can include multiple wildcards in the same word. For example, to find...
Read more >
How to make SQL Server Wildcard Searches Faster
Having the wildcard (%) at the end of the string when searching on uncertain characters is not as challenging as having the wildcard...
Read more >
Allow searching for part of a word (prefix / substring searches)
Linked Issues: is duplicated by. Suggestion JRASERVER-22406 - Want to search text for partial words or with a search string beginning with a...
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