[ADF-3677] Add highlight configuration to SearchQueryBuilder (#4358)

* [ADF-3677] Add highlight configuration to SearchQueryBuilder

* highlight property in search

* Update files.component.ts

* remove comma

* highlight missspell

* fix schhema json highilight

* fix test

* fix lint

* fix lint

* fix lint

* fix search sorting tests

* fix search sorting

* fix lint

* remove useless test

* check for null nodes

* remove duplicated test

* lint

* fix sorting tests

* remove test not search component related
This commit is contained in:
davidcanonieto
2019-03-17 17:23:07 +00:00
committed by Eugenio Romano
parent d6f391c40e
commit 8dc9eba4c7
19 changed files with 401 additions and 444 deletions

View File

@@ -23,7 +23,8 @@ import {
RequestFacetFields,
RequestFacetField,
RequestSortDefinitionInner,
ResultSetPaging
ResultSetPaging,
RequestHighlight
} from '@alfresco/js-api';
import { SearchCategory } from './search-category.interface';
import { FilterQuery } from './filter-query.interface';
@@ -227,7 +228,8 @@ export class SearchQueryBuilderService {
facetQueries: this.facetQueries,
facetIntervals: this.facetIntervals,
facetFields: this.facetFields,
sort: this.sort
sort: this.sort,
highlight: this.highlight
};
result['facetFormat'] = 'V2';
@@ -296,6 +298,10 @@ export class SearchQueryBuilderService {
return false;
}
get hasFacetHighlight(): boolean {
return this.config && this.config.highlight ? true : false;
}
protected get sort(): RequestSortDefinitionInner[] {
return this.sorting.map((def) => {
return new RequestSortDefinitionInner({
@@ -339,6 +345,10 @@ export class SearchQueryBuilderService {
return null;
}
protected get highlight(): RequestHighlight {
return this.hasFacetHighlight ? this.config.highlight : null;
}
protected getFinalQuery(): string {
let query = '';