Merge pull request #203 from pdmosses/search-config

Search config
This commit is contained in:
Patrick Marsceill
2019-09-09 16:00:11 -04:00
committed by GitHub
6 changed files with 24 additions and 6 deletions

View File

@@ -35,6 +35,10 @@ logo: "/assets/images/just-the-docs.png"
# Enable or disable the site search
# Supports true (default) or false
search_enabled: true
# Enable support for hyphenated search words:
search_tokenizer_separator: /[\s/]+/
```
## Aux links

View File

@@ -59,6 +59,15 @@ In your site's `_config.yml`, enable search:
search_enabled: true
```
The default is for hyphens to separate tokens in search terms:
`gem-based` is equivalent to `gem based`, matching either word.
To allow search for hyphenated words:
```yaml
# Set the search token separator
search_tokenizer_separator: /[\s/]+/
```
## Hiding pages from search
Sometimes you might have a page that you don't want to be indexed for the search nor to show up in search results, e.g, a 404 page. To exclude a page from search, add the `search_exclude: true` parameter to the page's YAML front matter: