mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-15 15:42:24 -06:00
Revert "Add configuration option search_tokenizer_separator"
This reverts commit 50cdf076b4c1859f5677919ccf2006e3ecc65e2e.
This commit is contained in:
parent
50cdf076b4
commit
4e65041849
@ -24,11 +24,6 @@ exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "pac
|
|||||||
# Enable or disable the site search
|
# Enable or disable the site search
|
||||||
search_enabled: true
|
search_enabled: true
|
||||||
|
|
||||||
# Set the search token separator
|
|
||||||
search_tokenizer_separator: /[\s\-/]+/
|
|
||||||
# For hyphenated-word search:
|
|
||||||
# search_tokenizer_separator: /[\s/]+/
|
|
||||||
|
|
||||||
# Enable or disable heading anchors
|
# Enable or disable heading anchors
|
||||||
heading_anchors: true
|
heading_anchors: true
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ function initSearch() {
|
|||||||
// Success!
|
// Success!
|
||||||
var data = JSON.parse(request.responseText);
|
var data = JSON.parse(request.responseText);
|
||||||
|
|
||||||
lunr.tokenizer.separator = {{ site.search_tokenizer_separator }}
|
lunr.tokenizer.separator = /[\s\-/]+/
|
||||||
var index = lunr(function () {
|
var index = lunr(function () {
|
||||||
this.ref('id');
|
this.ref('id');
|
||||||
this.field('title', { boost: 200 });
|
this.field('title', { boost: 200 });
|
||||||
|
@ -59,15 +59,6 @@ In your site's `_config.yml`, enable search:
|
|||||||
search_enabled: true
|
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
|
## 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:
|
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user