mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* [ADF-2847] Added class members heading to content services docs * [ADF-2847] Updated all prop/method tables in content services
64 lines
1.3 KiB
Markdown
64 lines
1.3 KiB
Markdown
---
|
|
Added: v2.3.0
|
|
Status: Active
|
|
---
|
|
|
|
# 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 = null)`<br/>
|
|
|
|
- `query: string = null` -
|
|
- `buildQuery(): QueryBody`<br/>
|
|
|
|
- **Returns** `QueryBody` -
|
|
|
|
- `execute(): Promise<void>`<br/>
|
|
|
|
- **Returns** `Promise<void>` -
|
|
|
|
- `getFacetQuery(label: string = null): FacetQuery`<br/>
|
|
|
|
- `label: string = null` -
|
|
- **Returns** `FacetQuery` -
|
|
|
|
- `removeFilterQuery(query: string = null)`<br/>
|
|
|
|
- `query: string = null` -
|
|
|
|
- `update()`<br/>
|
|
|
|
## Details
|
|
|
|
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 query expression
|
|
- include fields
|
|
- scope settings
|
|
- filter queries
|
|
- facet fields
|
|
- range queries
|
|
|
|
```ts
|
|
constructor(queryBuilder: SearchQueryBuilderService) {
|
|
|
|
queryBuilder.updated.subscribe(query => {
|
|
this.queryBuilder.execute();
|
|
});
|
|
|
|
queryBuilder.executed.subscribe(data => {
|
|
this.onDataLoaded(data);
|
|
});
|
|
|
|
}
|
|
```
|