* [ACS-6107] Removed date range component from ADF content-services * [ACS-6107] Removed references of date range component in code * [ACS-6107] Updated documentation to replace occurrences of date range component with date-range-advanced-tabbed component * [ACS-6107] Renamed DateRangeAdvanced to DateRange. Renamed DateRangeAdvancedTabbed to DateRangeTabbed * [ACS-6107] Fixed missing export of SearchDateRangeTabbedComponent * [ACS-6107] Replaced occurrences of date-range-advanced with date-range in HTML and Unit Tests automation ids * [ACS-6107] Documentation corrections * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Migrated unneeded E2E test case to unit test * [ACS-6107] Removed search-date-range E2E * [ACS-6107] Resolved PR comments. Removed date-range-filter.page.ts. Removed unused translation keys. Updated documentation to refer proper comment name * [ACS-6107] Updated documentation for SearchDateRange component to mention the change from original configuration to the newer configuration * [ACS-6107] Corrected wrong version in documentation * [ci:force] * [ACS-6107] Removed unneeded file * [ACS-6107] Updated unit tests and mock data after rebase * [ci:force] * [ACS-6107] Revert unneeded change. Remove unneeded file * [ci:force] * [ACS-6107] Updated E2E search config * [ci:force] * [ACS-6107] Updated E2E expects after component changes * [ci:force]
8.0 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Search Query Builder service | v2.3.0 | Active | 2019-03-19 |
Search Query Builder service
Stores information from all the custom search and faceted search widgets, compiles and runs the final search query.
Class members
Methods
-
addFilterQuery(query:
string
)
Adds a filter query to the current query.- query:
string
- Query string to add
- query:
-
addUserFacetBucket(field:
FacetField
, bucket:FacetFieldBucket
)
Adds a facet bucket to a field.- field:
FacetField
- The target field - bucket:
FacetFieldBucket
- Bucket to add
- field:
-
buildQuery():
SearchRequest
Builds the current query.- Returns
SearchRequest
- The finished query
- Returns
-
execute(queryBody?:
SearchRequest
)
Builds and executes the current query.- queryBody:
SearchRequest
- (Optional)
- queryBody:
-
getDefaultConfiguration():
SearchConfiguration
|undefined
- Returns
SearchConfiguration
|undefined
-
- Returns
-
getFacetField(label:
string
):FacetField
Gets a facet field by label.- label:
string
- Label of the facet field - Returns
FacetField
- Facet field data
- label:
-
getFacetQuery(label:
string
):FacetQuery
Gets a facet query by label.- label:
string
- Label of the query - Returns
FacetQuery
- Facet query data
- label:
-
getPrimarySorting():
SearchSortingDefinition
Gets the primary sorting definition.- Returns
SearchSortingDefinition
- The primary sorting definition
- Returns
-
getQueryGroup(query:
any
):any
Gets the query group.- query:
any
- Target query - Returns
any
- Query group
- query:
-
getScope():
RequestScope
- Returns
RequestScope
-
- Returns
-
getSearchFormDetails():
SearchForm
[]
- Returns
SearchForm
[]
-
- Returns
-
getSortingOptions():
SearchSortingDefinition
[]
Gets all pre-configured sorting options that users can choose from.- Returns
SearchSortingDefinition
[]
- Pre-configured sorting options
- Returns
-
getSupportedLabel(configLabel:
string
):string
Encloses a label name with double quotes if it contains whitespace characters.- configLabel:
string
- Original label text - Returns
string
- Label, possibly with quotes if it contains spaces
- configLabel:
-
getUserFacetBuckets(field:
string
):FacetFieldBucket
[]
Gets the buckets currently added to a field- field:
string
- The target fields - Returns
FacetFieldBucket
[]
- Bucket array
- field:
-
isFilterServiceActive():
boolean
- Returns
boolean
-
- Returns
-
loadConfiguration():
SearchConfiguration
- Returns
SearchConfiguration
-
- Returns
-
removeFilterQuery(query:
string
)
Removes an existing filter query.- query:
string
- The query to remove
- query:
-
removeUserFacetBucket(field:
FacetField
, bucket:FacetFieldBucket
)
Removes an existing bucket from a field.- field:
FacetField
- The target field - bucket:
FacetFieldBucket
- Bucket to remove
- field:
-
resetToDefaults()
-
search(queryBody:
SearchRequest
):Observable
<
ResultSetPaging
>
- queryBody:
SearchRequest
- - Returns
Observable
<
ResultSetPaging
>
-
- queryBody:
-
setScope(scope:
RequestScope
)- scope:
RequestScope
-
- scope:
-
update(queryBody?:
SearchRequest
)
Builds the current query and triggers theupdated
event.- queryBody:
SearchRequest
- (Optional)
- queryBody:
-
updateSelectedConfiguration(index:
number
)- index:
number
-
- index:
Details
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:
- categories
- query fragments that form a query expression
- include fields
- scope settings
- filter queries
- facet fields
- range queries
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.