alfresco-ng2-components/docs/content-services/search-query-builder.service.md
Andy Stark 69d8ff147e [ADF-3323] Updated doc tools to use DocFX intermediate files (#3601)
* [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
2018-08-14 15:42:25 +01:00

2.2 KiB

Added, Status, Last reviewed
Added Status Last reviewed
v2.3.0 Active 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)

    • query: string -
  • buildQuery(): QueryBody

    • Returns QueryBody -
  • execute(): Promise<void>

  • getFacetField(label: string): FacetField

    • label: string -
    • Returns FacetField -
  • getFacetQuery(label: string): FacetQuery

    • label: string -
    • Returns FacetQuery -
  • getPrimarySorting(): SearchSortingDefinition
    Returns primary sorting definition.

    • Returns SearchSortingDefinition -
  • getSortingOptions(): SearchSortingDefinition[]
    Returns all pre-configured sorting options that users can choose from.

    • Returns SearchSortingDefinition[] -
  • removeFilterQuery(query: string)

    • query: string -
  • resetToDefaults()

  • update()

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);
    });

}

See also