Extended Search
Extended search lets you search multiple fields at once.
By default every annotation
in your corpus is shown here, but you can limit or organize the selection as you see fit.
Group annotations in tabs
Grouping Annotations can currently only be done through BlackLab, by using the annotationGroups
setting in the .blf.yaml
configuration.
See the BlackLab docs for more info on that.
Here is a simple snippet illustrating the config for the example image. The ids here are just an example, in reality they depend entirely on your own configuration!
# my-corpus-format.blf.yaml
corpusConfig:
annotationGroups:
contents:
- name: Basics
annotations:
- word
- lemma
- pos
- name: More annotations
annotations:
- example
# etc...
TIP
If you've defined groups, any leftover annotations are put in a "remainder" group, which is hidden by default!
Order of annotations
The order of fields on the page is taken from the annotationGroups in the BlackLab .blf.yaml
used to create the corpus, falling back to order of declaration for fields not inside a group.
It's not currently possible to change the display order of these fields using the JS API.
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.
Alternatively, these are the dedicated functions:
vuexModules.ui.actions.search.extended.searchAnnotationIds(['word', 'lemma']);
function searchAnnotationIds(ids: string[]): void;
Split-Batch
Split batch search is a feature that quickly allows you search for multiple terms in quick succession. It will split your query into many small subqueries, which are put in the history.
For example a query like [word="a|b" & lemma="c|d"]
will result in 4 searches in the history:
[lemma = "a"]
[lemma = "b"]
[word = "c"]
[word = "d"]
The first query in the list is submitted, and the rest is pushed into the history so the user can load them at a later moment.
It can be hidden using the API:
vuexModules.ui.actions.search.extended.splitBatch.enable(false);
function enable(status: boolean): void;
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)
};