/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Filter } from "../../types/senselogic/sitevision/api/search/searcher/component/Filter"; import type { Highlight } from "../../types/senselogic/sitevision/api/search/searcher/component/Highlight"; import type { Node } from "../../types/javax/jcr/Node"; import type { Parser } from "../../types/senselogic/sitevision/api/search/searcher/component/Parser"; import type { Sort } from "../../types/senselogic/sitevision/api/search/searcher/component/Sort"; import type { SpellCheck } from "../../types/senselogic/sitevision/api/search/searcher/component/SpellCheck"; import type { Monitor } from "../../types/senselogic/sitevision/api/search/searcher/component/Monitor"; import type { PermissionCheck } from "../../types/senselogic/sitevision/api/search/searcher/component/PermissionCheck"; import type { Searcher } from "../../types/senselogic/sitevision/api/search/searcher/Searcher"; import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder"; /** *
* Builder for creating a {@link senselogic.sitevision.api.search.searcher.Searcher} with a specific setup of components. *
* ** The following components can be set. All components are optional. *
*null (i.e. no filtering).
* null (i.e. no suggestions).
* null (i.e. no highlighting).
* null (i.e. no sorting).
* null (i.e. no monitoring).
* null (legacy default permission checking strategy will be used).
* * What index to query can also be specified. Default is the default node index * (i.e. the main index with pages/images/files etc.). *
* ** Example of how to use the SearchBuilder to create a Searcher in Velocity: *
*
* ## Get the search factory
* #set ($searchFactory = $sitevisionUtils.searchFactory)
*
* ## Create a Filter component
* #set ($filterBuilder = $searchFactory.filterBuilder)
* #set ($filter = $filterBuilder.addFilterQuery('metadata.category:responsive').build())
*
* ## Create a Highlight component
* #set ($highlightBuilder = $searchFactory.highlightBuilder)
* #set ($highlight = $highlightBuilder.addHighlightedField('summary').build())
*
* ## Create a Sort component
* #set ($lastPublishedSort = $searchFactory.getSearchSortField('lastpublished', true))
* #set ($sortBuilder = $searchFactory.sortBuilder)
* #set ($sort = $sortBuilder.addSortField($lastPublishedSort).build())
*
* ## Get the search builder
* #set ($searcherBuilder = $searchFactory.searcherBuilder)
*
* ## Set all components and create the Searcher
* #set ($searcher = $searcherBuilder.setFilter($filter).setHighlight($highlight).setSort($sort).build())
*
* ## Search and handle the result
* #set ($searchResult = $searcher.search('example*', 10))
* ...
*
*
* * Tip! The {@link senselogic.sitevision.api.base.Builder Builder interface documentation} contains * more information about Builders and how to work with them! *
* *
* An instance of the Sitevision class implementing this interface can be obtained via
* {@link senselogic.sitevision.api.search.SearchFactory#getSearcherBuilder()}.
* See {@link senselogic.sitevision.api.search.SearchFactory} for how to obtain an instance of the SearchFactory interface.
*
* A Filter instance is created via the {@link FilterBuilder#build()} method.
*
* A Highlight instance is created via the {@link HighlightBuilder#build()} method.
*
* Note! If no index is set, the Searcher that is constructed will use
* the default node index (i.e. the main index with pages/images/files etc.).
*
* Tip! Use the {@link senselogic.sitevision.api.search.index.IndexUtil} utility to get an index. *
* @param anIndex the index * @return this builder * @throws IllegalArgumentException ifanIndex isn't an index node (primary node type name should be
sv:nodeIndex or sv:applicationIndex)
*/
setIndex(anIndex: Node): SearcherBuilder;
/**
* Sets the parser component.
*
*
* A Parser instance is created via the {@link ExtendedDismaxParserBuilder#build()} method
* or the {@link StandardParserBuilder#build()} method.
*
* Note! If no Parser is set, the Searcher that is constructed will use a default multi-field
* parser (that can be constructed via {@link ExtendedDismaxParserBuilder}).
*
* A Sort instance is created via the {@link SortBuilder#build()} method.
*
* A SpellCheck instance is created via the {@link SpellCheckBuilder#build()} method.
*
* A Monitor instance is created via the {@link MonitorBuilder#build()} method.
*
* Note! This component is only applicable when querying a Node index (sv:nodeIndex)!
*
* When querying a Custom Node index that is populated with external data, you should typically set a permission check component * that specifies the {@link senselogic.sitevision.api.search.searcher.component.PermissionStrategy#EARLY_CHECK} strategy. *
*
*
* Legacy: a Searcher without any PermissionCheck component will use a legacy default strategy when checking
* permissions. This strategy is a mix of EARLY_CHECK and LATE_CHECK that is kept as-is for legacy reasons only.
* New search solutions with Searcher should typically specify a PermissionCheck component when querying
* a sv:nodeIndex.
*
*
* A PermissionCheck instance is created via the {@link PermissionCheckBuilder#build()} method.
*