mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* [ADF-3323] Moved source file parsing to main doc tool * [ADF-3323] Moved source info classes * [ADF-3323] Added doc YAML generator tool * [ADF-3323] Added doc YAML/JSON source paths to gitignore * [ADF-3323] Completed templates and template context code * [ADF-3323] Added source paths and updated type linker * [ADF-3323] Final fixes to templates and type linking * [ADF-3323] Fixed filter for private and protected methods * [ADF-3323] Content services docs after check and rebuild * [ADF-3323] Updated docbuild script in package.json
87 lines
2.2 KiB
Markdown
87 lines
2.2 KiB
Markdown
---
|
|
Added: v2.3.0
|
|
Status: Active
|
|
Last reviewed: 2018-06-12
|
|
---
|
|
|
|
# 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`)<br/>
|
|
|
|
- _query:_ `string` -
|
|
|
|
- **buildQuery**(): `QueryBody`<br/>
|
|
|
|
- **Returns** `QueryBody` -
|
|
|
|
- **execute**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>`<br/>
|
|
|
|
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>` -
|
|
|
|
- **getFacetField**(label: `string`): `FacetField`<br/>
|
|
|
|
- _label:_ `string` -
|
|
- **Returns** `FacetField` -
|
|
|
|
- **getFacetQuery**(label: `string`): `FacetQuery`<br/>
|
|
|
|
- _label:_ `string` -
|
|
- **Returns** `FacetQuery` -
|
|
|
|
- **getPrimarySorting**(): `SearchSortingDefinition`<br/>
|
|
Returns primary sorting definition.
|
|
- **Returns** `SearchSortingDefinition` -
|
|
- **getSortingOptions**(): `SearchSortingDefinition[]`<br/>
|
|
Returns all pre-configured sorting options that users can choose from.
|
|
- **Returns** `SearchSortingDefinition[]` -
|
|
- **removeFilterQuery**(query: `string`)<br/>
|
|
|
|
- _query:_ `string` -
|
|
|
|
- **resetToDefaults**()<br/>
|
|
|
|
- **update**()<br/>
|
|
|
|
## Details
|
|
|
|
See the [Search filter component](search-filter.component.md) 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
|
|
|
|
```ts
|
|
constructor(queryBuilder: SearchQueryBuilderService) {
|
|
|
|
queryBuilder.updated.subscribe(query => {
|
|
this.queryBuilder.execute();
|
|
});
|
|
|
|
queryBuilder.executed.subscribe(data => {
|
|
this.onDataLoaded(data);
|
|
});
|
|
|
|
}
|
|
```
|
|
|
|
## See also
|
|
|
|
- [Search filter component](search-filter.component.md)
|
|
- [Search Widget interface](search-widget.interface.md)
|