Addition of "doctype"/datatype as another possible facet and search element to use

This commit is contained in:
Porras-Bernardez 2024-08-19 15:45:52 +02:00
parent 110c2db8bf
commit 03a55f6a58
7 changed files with 42 additions and 10 deletions

View file

@ -34,6 +34,8 @@ export default class ActiveFacetCategory extends Vue {
return "creator";
case "subjects":
return "keyword";
case "doctype":
return "datatype";
default:
return this.categoryName;
}

View file

@ -33,6 +33,8 @@ export default class FacetCategory extends Vue {
return "creator";
case "subjects":
return "keyword";
case "doctype":
return "datatype";
default:
return this.filterName;
}

View file

@ -140,6 +140,17 @@ export default class VsInput extends Vue {
}
}
// To allow search by doctype
if (highlight.doctype && highlight.doctype.length > 0) {
const highlightedDoctype = highlight.doctype.join(" ");
const hasDoctypeSuggestion = suggestions.some((suggestion) => suggestion.highlight.toLowerCase() === highlightedDoctype.toLowerCase() && suggestion.type == SearchType.Doctype);
if (!hasDoctypeSuggestion) {
const suggestion = new Suggestion(dataset.doctype, highlightedDoctype, SearchType.Doctype);
suggestions.push(suggestion);
}
}
// ORIGINAL SOLR ===================================================================================================
// if (dataset.title_output.toLowerCase().includes(this.display.toLowerCase())) {
// const title = dataset.title_output;