Advanced Search (Querybuilder)
Hide the Advanced Search
vuexModules.ui.actions.search.advanced.enable(false)
Within
It's also possible to set which tags are shown (and how) in within
.
You can only add tags that you actually index (using the inlineTags options in your index config yaml)
vuexModules.ui.actions.search.shared.within.elements({
title: 'Tooltip here (optional)',
label: 'Sentence',
value: 's'
});
Lastly, if your corpus has dependency relations, you can set which inline tag is used for the sentence boundary when viewing a hit's dependency tree. The tree component will then show all words between two of these tags. There is rudimentary autodetection that tries to find the most likely tag, but you can override this by setting the tag manually.
vuexModules.ui.acions.search.shared.within.sentenceBoundary('s')
To hide the within
altogether:
vuexModules.ui.actions.search.shared.within.enable(false);
Attributes
// Customize which spans are shown in the within widget
corpus.search.within.includeSpan = function (name) {
if (name === 'boring-span')
return false; // hide this span
return null; // default behaviour (all spans)
};
// Customize if fields for any attributes are shown in
// the within widget when selecting certain spans
corpus.search.within.includeAttribute = function (name, attrName) {
if (name === 'chapter') {
// show this attribute
return attrName === 'number';
}
return null; // default behaviour (no attributes)
};
Show or Hide annotations
TIP
Prefer the table-based configuration for managing search form fields.
It centralizes settings and uses the same underlying functions as manual methods.
⚠️ The table-based method may not cover all cases. For advanced customizations, override with dedicated functions as needed.
vuexModules.ui.actions.search.advanced.searchAnnotationIds(['word', 'lemma']);
Default annotation
You can change the default selected annotation:
vuexModules.ui.actions.search.advanced.defaultSearchAnnotationId('word');