--- layout: default title: Search nav_order: 7 --- # Search {: .no_toc } ## Table of contents {: .no_toc .text-delta } 1. TOC {:toc} --- Just the Docs uses [lunr.js](http://lunrjs.com) to add a client-side search interface powered by a JSON index that Jekyll generates. All search results are shown in an auto-complete style interface (there is no search results page). By default, all generated HTML pages are indexed using the following data points: - Page title - Page content - Page URL ## Set up search ### Generate search index Before you can use search, you must initialize the feature by running this `rake` command that comes with `just-the-docs`: ```bash $ bundle exec just-the-docs rake search:init ``` This command creates the `search-data.json` file that Jekyll uses to create your search index. Alternatively, you can create the file manually in the `assets/js/` directory of your Jekyll site with this content: ```liquid {% raw %}--- --- { {% assign comma = false %} {% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": { "title": "{{ page.title | replace: '&', '&' }}", "content": "{{ page.content | markdownify | replace: '