Test that long words are omitted from the search index.

Note they do appear in the 'docs' part of searchindex.json (so they will be
visible in search teasers).
This commit is contained in:
Matthew Woodcraft 2022-05-22 13:57:09 +01:00
parent d65ce55453
commit 00a55b35a8
3 changed files with 5 additions and 3 deletions

View file

@ -1,3 +1,5 @@
Capybara capybara capybara.
Capybara capybara capybara.
Capybara capybara capybara.
ThisLongWordIsIncludedSoWeCanCheckThatSufficientlyLongWordsAreOmittedFromTheSearchIndex.

View file

@ -772,7 +772,7 @@ mod search {
);
assert_eq!(
docs[&no_headers]["body"],
"Capybara capybara capybara. Capybara capybara capybara."
"Capybara capybara capybara. Capybara capybara capybara. ThisLongWordIsIncludedSoWeCanCheckThatSufficientlyLongWordsAreOmittedFromTheSearchIndex."
);
}

View file

@ -229,7 +229,7 @@
"title": "Unicode stress tests"
},
"18": {
"body": "Capybara capybara capybara. Capybara capybara capybara.",
"body": "Capybara capybara capybara. Capybara capybara capybara. ThisLongWordIsIncludedSoWeCanCheckThatSufficientlyLongWordsAreOmittedFromTheSearchIndex.",
"breadcrumbs": "First Chapter » No Headers",
"id": "18",
"title": "First Chapter"