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.

Index example searching itself

See original GitHub issue

When I use the following code (taken from your example in the docs) to create an index, it is matching the words in the index itself. I have the index at the end of the book. Does that make a difference?

Bindery.PageReference({
  selector: ".index-section li",
  createTest: (el) => {
    const searchTerm = el.textContent.toLowerCase().trim();
    return (pageEl) => {
      const textToSearch = pageEl.textContent.toLowerCase();
      return textToSearch.includes(searchTerm);
    }
  },
})

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
evnbrcommented, Aug 25, 2017

The bug parts should be fixed in new build (v2.0.0-alpha.5)

0reactions
teddybradfordcommented, Aug 25, 2017

I think returning a string is fine as a basic option, but also having an option to return an array could be useful for more advanced styling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a Search Index and How does it work? - AddSearch
A search index helps users quickly find information on a website. It is designed to map search queries to documents or URLs that...
Read more >
How Does Indexing Work | Tutorial by Chartio
Indexing is the way to get an unordered table into an order that will maximize the query's efficiency while searching. When a table...
Read more >
How Search Engines Work: Crawling, Indexing, and Ranking
For example, you may search for “shoes” on Amazon, and then refine your ... Ask yourself this: Can the bot crawl through your...
Read more >
Google search indexes itself - Hacker News
They probably want to index some pages on google.com, but not search results. To exclude search results, someone wrote something to exclude URLs ......
Read more >
Search engine indexing - Wikipedia
Search engine indexing is the collecting, parsing, and storing of data to facilitate fast and accurate information retrieval. Index design incorporates ...
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