Add search profiles for wiki, forum and docs.

This commit is contained in:
Viktor Lofgren 2023-06-24 12:17:35 +02:00
parent bd2c3855ed
commit d86e8522e2
2 changed files with 17 additions and 0 deletions

View File

@ -19,6 +19,9 @@ public enum SearchProfile {
FOOD("food", SearchSetIdentifier.NONE),
CRAFTS("crafts", SearchSetIdentifier.NONE),
CLASSICS("classics", SearchSetIdentifier.NONE),
FORUM("forum", SearchSetIdentifier.NONE),
WIKI("wiki", SearchSetIdentifier.NONE),
DOCS("docs", SearchSetIdentifier.NONE),
;
@ -56,6 +59,15 @@ public enum SearchProfile {
if (this == PLAIN_TEXT) {
subquery.searchTermsAdvice.add("format:plain");
}
if (this == WIKI) {
subquery.searchTermsAdvice.add("generator:wiki");
}
if (this == FORUM) {
subquery.searchTermsAdvice.add("generator:forum");
}
if (this == DOCS) {
subquery.searchTermsAdvice.add("generator:docs");
}
if (this == FOOD) {
subquery.searchTermsAdvice.add(HtmlFeature.CATEGORY_FOOD.getKeyword());
}

View File

@ -17,6 +17,11 @@
<option {{#eq profile "vintage"}}selected{{/eq}} value="vintage">Web 1.0</option>
<option {{#eq profile "plain-text"}}selected{{/eq}} value="plain-text">Text Files</option>
</optgroup>
<optgroup label="Category">
<option {{#eq profile "wiki"}}selected{{/eq}} value="wiki">Wiki</option>
<option {{#eq profile "forum"}}selected{{/eq}} value="forum">Forum</option>
<option {{#eq profile "docs"}}selected{{/eq}} value="docs">Docs (experimental)</option>
</optgroup>
<optgroup label="Topics Search">
<option {{#eq profile "food"}}selected{{/eq}} value="food">Recipes &#127859;</option>
<option {{#eq profile "crafts"}}selected{{/eq}} value="crafts">Crafts &#129697;&#128296; (WIP; mostly textile-craft)</option>