Questions tagged [lunrjs]

Simple full-text search in your browser

lunr.js is a simple full text search engine for your client side applications. It is designed to be small, yet full featured, enabling you to provide a great search experience without the need for external, server side, search services.

lunr.js has no external dependencies, although it does require a modern browser with ES5 support. In older browsers you can use an ES5 shim, such as augment.js, to provide any missing JavaScript functionality.

https://lunrjs.com/

48 questions
11
votes
1 answer

lunr.js Add data about an index record

In lunr.js, you can add a unique reference using the .ref() method but I can't find any method to add extra data/info about that particular record. Is it not possible or am I missing something really obvious. I even tried assigning an object to ref…
Sourabh
  • 8,243
  • 10
  • 52
  • 98
8
votes
2 answers

Can't add documents to lunr index after assignment (TypeError: idx.add is not a function)

I'm trying to create a lunr index and be able to add documents to it after being assigned. This is a slightly simplified version of what I'm trying to do: var documents = [{ 'id': '1', 'content': 'hello' }, { 'id': '2', 'content':…
user3163192
  • 111
  • 1
  • 9
3
votes
1 answer

Hugo search with lurn does not search in front matter metadata when using sections

We are bulding a website with hugo and added lunr.js for search. The content which is the .Content area is indexed but where there are sections in front matter (metadata) of the post, these contents are not indexed. Example post with content in…
isin
  • 155
  • 1
  • 10
3
votes
1 answer

Why won't lunr index multiple word strings in JSON arrays?

Lunr is doing a great job finding most results, but I can't figure out why it won't return multi-word strings contained in JSON arrays. Here's a sample JSON file to get a sense of how my data is structured: [{ "title": "Rolling Loud", …
Corbin
  • 87
  • 1
  • 7
3
votes
1 answer

How to search using lunr.js

lunr.js worked like charm with data in below format [{ 'id': 1, 'first_name': 'Joseph', 'last_name': 'Williams', 'email': 'jwilliams0@hud.gov', 'gender': 'Male', 'age': 94 }, { 'id': 2, …
skeep
  • 940
  • 6
  • 14
3
votes
1 answer

Jekyll search with Lunr JS, not working

I'm trying to implement search on my Jekyll site using Lunar JS with this plugin. https://github.com/slashdotdash/jekyll-lunr-js-search I'm following the instructions in the readme but to a beginner they are not so clear. I've followed everything…
Lars
  • 7,908
  • 11
  • 52
  • 70
2
votes
0 answers

How do I add lunr (or elasticlunr) search on an HTML page?

I have been trying unsuccessfully to make an offline HTML FAQ page that searches for answers in a JSON document, however, I cannot figure out how to get it working. The main thing I tried is downloading the HTML and JS from the lunr example on the…
Enderman
  • 21
  • 1
2
votes
2 answers

Importing lunr in typescript?

The Defintely Typed repository imports it like this: import * as lunr from 'lunr'; However when using it like that in Stackblitz it errors with: lunr is not a function Thoughts? This is the…
Ole
  • 41,793
  • 59
  • 191
  • 359
2
votes
2 answers

How to activate book-wide or page-local search for bookdown

I have not been able to debug why the HTML generated from my bookdown only displays the search button on Chrome (not in Firefox or Safari), doesn't do anything in Chrome even though CTRL-F does, and only searches the local page rather than the book…
Bob Carpenter
  • 3,613
  • 1
  • 20
  • 13
2
votes
0 answers

Does elasticlunr support exact match

I couldn't find any information about exact-match search with elascticlunr.js. Just curious if it's supported or possible in some other way? Using Thanks.
Saim
  • 2,471
  • 5
  • 30
  • 43
2
votes
1 answer

Greek language support for lunr.js

Registering a new stemmer function in lunr for greek words doesn't work as expected. here is my code on codepen. I am not receiving any errors, the function stemWord() works fine when used separately but it fails to stem the words in lunr. below is…
2
votes
0 answers

Server-less search engine using Firebase and Lunr.js or other helping libraries

Firebase does not really have the capabilities in full-text searching yet so I was wondering if Lunr.js can help (or other libraries). I'd like to know how or to create a good scheme in indexing data directly in Firebase and if Lunr.js can help me…
1
vote
1 answer

Lunrjs search on Jekyll website not working with TypeError

Update: Although I still haven't figured this out, I found an alternative that works: Search with Lunr.js | Jekyll Codex I've been following this CloudCannon Academy tutorial on Jekyll search using lunr.js, but I still haven't get it working after…
user17833356
1
vote
1 answer

How do I build Lunr search for Markdown MD Documents

I am needing to add a a good lunr search to my MD (Markdown) documents across my site. I am working with React/ NextJS site and we have a lot of Markdown docs in both blog and regular "docs" areas. We need a search for those documents, so website…
Kim Gentes
  • 1,496
  • 1
  • 18
  • 38
1
vote
1 answer

How to open a new page with search results in Jekyll using w/ Lunr.js?

I'm having a bit of trouble trying to display the search result in a new page titled results.html using this guide here. It seems as though its setup to display results on the page where the search is being made which isn't what I'm looking…
JamesRocky
  • 721
  • 9
  • 23
1
2 3 4