Stores information from all the custom search and faceted search widgets, compiles and runs the final search query.
addFilterQuery(query: string
)
Adds a filter query to the current query.
string
- Query string to addaddUserFacetBucket(field: FacetField
, bucket: FacetFieldBucket
)
Adds a facet bucket to a field.
FacetField
- The target fieldFacetFieldBucket
- Bucket to addbuildQuery(): QueryBody
Builds the current query.
QueryBody
- The finished queryexecute(queryBody?: QueryBody
)
Builds and executes the current query.
QueryBody
- (Optional)getDefaultConfiguration(): SearchConfiguration
|undefined
SearchConfiguration
|undefined
- getFacetField(label: string
): FacetField
Gets a facet field by label.
string
- Label of the facet fieldFacetField
- Facet field datagetFacetQuery(label: string
): FacetQuery
Gets a facet query by label.
string
- Label of the queryFacetQuery
- Facet query datagetPrimarySorting(): SearchSortingDefinition
Gets the primary sorting definition.
SearchSortingDefinition
- The primary sorting definitiongetQueryGroup(query: any
): any
Gets the query group.
any
- Target queryany
- Query groupgetScope(): RequestScope
RequestScope
- getSearchFormDetails(): SearchForm
[]
SearchForm
[]
- getSortingOptions(): SearchSortingDefinition
[]
Gets all pre-configured sorting options that users can choose from.
SearchSortingDefinition
[]
- Pre-configured sorting optionsgetSupportedLabel(configLabel: string
): string
Encloses a label name with double quotes if it contains whitespace characters.
string
- Original label textstring
- Label, possibly with quotes if it contains spacesgetUserFacetBuckets(field: string
): FacetFieldBucket
[]
Gets the buckets currently added to a field
string
- The target fieldsFacetFieldBucket
[]
- Bucket arrayisFilterServiceActive(): boolean
boolean
- loadConfiguration(): SearchConfiguration
SearchConfiguration
- removeFilterQuery(query: string
)
Removes an existing filter query.
string
- The query to removeremoveUserFacetBucket(field: FacetField
, bucket: FacetFieldBucket
)
Removes an existing bucket from a field.
FacetField
- The target fieldFacetFieldBucket
- Bucket to removeresetToDefaults()
search(queryBody: QueryBody
): Observable
<
ResultSetPaging
>
QueryBody
- Observable
<
ResultSetPaging
>
- setScope(scope: RequestScope
)
RequestScope
- update(queryBody?: QueryBody
)
Builds the current query and triggers the updated
event.
QueryBody
- (Optional)updateSelectedConfiguration(index: number
)
number
-See the Search filter component page for full details about the format of queries, facet fields, and sorting options.
The Query Builder is UI agnostic and does not rely on Angular components. You can reuse it with multiple component implementations.
You can use custom widgets to populate and edit the following parts of the resulting query:
constructor(queryBuilder: SearchQueryBuilderService) {
queryBuilder.updated.subscribe(query => {
this.queryBuilder.execute();
});
queryBuilder.executed.subscribe(data => {
this.onDataLoaded(data);
});
}
Note: From ADF 3.0.0, the query contains the
"facetFormat": "V2"
parameter so that all the responses have the same structure whether they come from search queries containing facetFields, facetQueries, grouped facetQueries or facetIntervals.
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.