mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF- 2670] Checked and updated docs for 2.3 (#3197)
* [ADF-2670] Reviewed docs for 2.3 with only minor changes * [ADF-2670] Checked and updated docs for 2.3
This commit is contained in:
committed by
Eugenio Romano
parent
e4b9d775a2
commit
460e33ccdb
57
docs/content-services/search-query-builder.service.md
Normal file
57
docs/content-services/search-query-builder.service.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
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): void`
|
||||
Adds a filter query to the search.
|
||||
- `query` - Query text
|
||||
- `removeFilterQuery(query: string): void`
|
||||
Removes a previously added filter query from the search.
|
||||
- `query` - Query text
|
||||
- `getFacetQuery(label: string): FacetQuery`
|
||||
Gets a facet query.
|
||||
- `label` - Identifier of the target query
|
||||
- `update(): void`
|
||||
Rebuilds the query and triggers the `updated` event.
|
||||
- `async execute()`
|
||||
Executes the query.
|
||||
- `buildQuery(): QueryBody`
|
||||
Builds the query.
|
||||
|
||||
## 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);
|
||||
});
|
||||
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user