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 doesn't return result

See original GitHub issue

The following code

var index = new FlexSearch("memory", {
	    encode: "balance",
	    tokenize: "forward",
	    threshold: 0
	})

const allData = await GetAllVideos() // load data from mongo db

	allData.map( item => {
			item.categories.forEach( it => {
				if(it === 'Babe') console.log(it)

				index.add(item._id, it)
			})
		})

	index.search('Babe', res => {
		console.log('Result', res)
	})

Returns

Babe
Babe
Babe
Babe
Babe
Babe
Babe
Babe
Babe
Babe
Babe
Result []

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nevfcommented, Apr 16, 2020

@shazgames Is it simply that you need to include encode: "icase" ie. The index contains “babe” but you search is for “Babe”.

I don’t think this is a bug in flexsearch.

@Leyart He is only searching for a single term, so I don’t see how #96 is relevant.

0reactions
ts-thomascommented, Jun 28, 2021

Please change over to the version >= 0.7.x, thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel SEARCH function not returning expected results
Yes SEARCH will return an array, but you need to do something with that array or it will only return the first result:...
Read more >
Search in Outlook doesn't return any results in many cases
A client of ours experiences issues when using Outlook search When searching for mails in most cases the resulting list is correct.
Read more >
Google Search Won't Return Search Results For Some ...
Yesterday some searchers began complaining that Google search would not return search results for them. Instead, Google would return an ...
Read more >
Search bar wont return results [closed] - Stack Overflow
Cant figure out what's going wrong here, no errors are appearing but nothing is being returned. The search bar should return the names...
Read more >
How to Fix When Excel Find Is Not Working
The most common reason for the error is that the string you're searching doesn't exist. Say you have a data set with prices...
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