Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search config #203

Merged
merged 10 commits into from Sep 9, 2019
Merged

Search config #203

merged 10 commits into from Sep 9, 2019

Conversation

@pdmosses
Copy link
Contributor

pdmosses commented Aug 29, 2019

(My previous PR #188 was made from my master fork, which was a mistake. For this one, I've made a topic branch in which I've reverted the previous commits.)

See #194 for the related enhancement request. This PR simply adds a config option search_tokenizer_separator which can be adjusted to support search for hyphenated words. (It does not enable the use of + and - in search terms.)

To test:

  • search for gem-based, which matches both gem and based;
  • set search_tokenizer_separator: /[\s/]+/ in _config.yml;
  • after restarting Jekyll, search for gem-based, which matches exactly that word.
pdmosses added 8 commits Aug 29, 2019
This reverts commit 209ac7b.
This reverts commit c282e4b.
This reverts commit 0cfc0f0.
This reverts commit 13ef185.
The default is for hyphens to separate tokens in search terms: `gem-based` is equivalent to `gem based`.

This adds `search_tokenizer_separator` as a site configuation option, to support search for hyphenated words.
@pdmosses

This comment has been minimized.

Copy link
Contributor Author

pdmosses commented Aug 29, 2019

The only non-reverted commit in this PR is 50cdf07.

@pdmosses

This comment has been minimized.

Copy link
Contributor Author

pdmosses commented Aug 29, 2019

BTW, the instructions in https://pmarsceill.github.io/just-the-docs/docs/search/#generate-search-index appear to be obsolete.

assets/js/just-the-docs.js Show resolved Hide resolved
docs/search.md Show resolved Hide resolved
pdmosses and others added 2 commits Sep 9, 2019
Added documentation for `search_tokenizer_separator`.
@pmarsceill pmarsceill changed the base branch from master to v0.2.7-release Sep 9, 2019
@pmarsceill pmarsceill mentioned this pull request Sep 9, 2019
@pmarsceill pmarsceill merged commit 850a8fe into pmarsceill:v0.2.7-release Sep 9, 2019
@pdmosses

This comment has been minimized.

Copy link
Contributor Author

pdmosses commented Sep 9, 2019

Thanks!

BTW, wouldn't it be simpler to use Liquid's default filter in such cases, instead of a conditional?
https://shopify.github.io/liquid/filters/default/
(I haven't actually tried using it yet...)

@pdmosses pdmosses deleted the pdmosses:search-config branch Sep 9, 2019
@pdmosses

This comment has been minimized.

Copy link
Contributor Author

pdmosses commented on 690d0b5 Sep 10, 2019

It seems this revert on nav.html was inadvertently included in 0.2.7 (my commits got in a mess with making the original PR on my fork master, and later trying to separate it from subsequent PRs...). Apologies for not noticing this before the 0.2.7 release.

Anyway, there is now no need to reopen #173, as the issue is addressed by the recursive navigation PR #192.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.