[ADF-5417] Support multiple search configuration in app config json (#7096)

* [ACS-1642] Support multiple search configuration in app config json

* [ci:force] unit test added

* adf component added

* [ci:force] check compatibility

* [ci:force] * run all e2e

* * revert initvalue

* [ci:force] revert app config

* [ci:force] docs update
This commit is contained in:
Dharan
2021-06-15 18:22:46 +05:30
committed by GitHub
parent 1cffef9421
commit ba03c60adb
55 changed files with 909 additions and 475 deletions

View File

@@ -498,6 +498,404 @@
}
}
]
},
"search-configuration": {
"description": "Search configuration parameters",
"type": "object",
"required": [
"categories"
],
"properties": {
"include": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"fields": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"filterQueries": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"type": "string"
}
}
}
},
"filterWithContains": {
"type": "boolean"
},
"resetButton": {
"type": "boolean"
},
"facetFields": {
"type": "object",
"required": [
"fields"
],
"properties": {
"expanded": {
"description": "Toggles expanded state of the facet field",
"type": "boolean"
},
"fields": {
"description": "List of custom facet fields",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"field",
"mincount",
"label"
],
"properties": {
"field": {
"type": "string",
"description": "This specifies the facet field."
},
"mincount": {
"type": "number",
"description": "This specifies the minimum count required for a facet field to be included in the response. The default value is 1."
},
"label": {
"type": "string",
"description": "This specifies the label to include in place of the facet field."
},
"prefix": {
"type": "string",
"description": "This restricts the possible constraints to only indexed values with a specified prefix."
},
"limit": {
"type": "number",
"description": "Maximum number of results"
},
"pageSize": {
"type": "number",
"description": "Display page size"
},
"offset": {
"type": "integer"
}
}
}
}
}
},
"facetIntervals": {
"type": "object",
"required": [
"intervals"
],
"properties": {
"intervals": {
"description": "List of facet intervals",
"type": "array",
"items": {
"type": "object",
"required": [
"label",
"field",
"sets"
],
"properties": {
"label": {
"description": "This specifies the label to use to identify the field facet.",
"type": "string"
},
"field": {
"description": "This specifies the field to facet on.",
"type": "string"
},
"sets": {
"type": "array",
"items": {
"type": "object",
"required": [
"label",
"start",
"end"
],
"properties": {
"label": {
"description": "This specifies the label to use to identify the set.",
"type": "string"
},
"start": {
"description": "This specifies the start of the range.",
"type": "string"
},
"end": {
"description": "This specifies the end of the range.",
"type": "string"
},
"startInclusive": {
"description": "When true, the set will include values greater or equal to 'start'. The default value is true.",
"type": "boolean"
},
"endInclusive": {
"description": "When true, the set will include values less than or equal to 'end'. The default value is true.",
"type": "boolean"
}
}
}
},
"pageSize": {
"type": "number",
"description": "Display page size"
},
"mincount": {
"type": "number",
"description": "This specifies the minimum count required for a facet interval to be displayed. The default value is 1."
}
}
}
},
"expanded": {
"description": "Toggles expanded state of the facet intervals",
"type": "boolean"
}
}
},
"facetQueries": {
"type": "object",
"required": [
"label",
"queries"
],
"properties": {
"label": {
"description": "Label text for the default facet queries group",
"type": "string"
},
"pageSize": {
"description": "Default page size for the facet queries groups",
"type": "number"
},
"expanded": {
"description": "Toggles expanded state of the facet queries groups",
"type": "boolean"
},
"mincount": {
"description": "This specifies the minimum count required for a facet query to be displayed. The default value is 1.",
"type": "number"
},
"queries": {
"description": "List of custom facet queries",
"type": "array",
"items": {
"type": "object",
"required": [
"query",
"label"
],
"properties": {
"query": {
"type": "string"
},
"label": {
"description": "Unique identifier for the query",
"type": "string"
},
"group": {
"description": "The group that the facet query belongs to. If no group is defined, the facet query will appear under the default facet queries group label",
"type": "string"
}
}
}
}
}
},
"categories": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {},
"name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"expanded": {
"type": "boolean"
},
"component": {
"type": "object",
"required": [
"selector",
"settings"
],
"properties": {
"selector": {
"description": "Unique component runtime identifier",
"type": "string"
},
"settings": {
"description": "Component-specific settings",
"type": "object"
}
}
}
}
}
},
"highlight": {
"type": "object",
"description": " Request that highlight fragments to be added to result set rows The properties reflect SOLR highlighting parameters.",
"properties": {
"prefix": {
"description": "The string used to mark the start of a highlight in a fragment",
"type": "string"
},
"postfix": {
"description": "The string used to mark the end of a highlight in a fragment",
"type": "string"
},
"snippetCount": {
"description": "The maximum number of distinct highlight snippets to return for each highlight field",
"type": "number"
},
"fragmentSize": {
"description": "The character length of each snippet",
"type": "number"
},
"maxAnalyzedChars": {
"description": "The number of characters to be considered for highlighting. Matches after this count will not be shown",
"type": "number"
},
"mergeContiguous": {
"description": "If fragments over lap they can be merged into one larger fragment",
"type": "boolean"
},
"usePhraseHighlighter": {
"description": "Should phrases be identified",
"type": "boolean"
},
"fields": {
"type": "array",
"minItems": 1,
"items": {
"description": "The fields to highlight and field specific configuration properties for each field",
"type": "object",
"properties": {
"field": {
"description": "The name of the field to highlight",
"type": "string"
},
"snippetCount": {
"type": "number"
},
"fragmentSize": {
"type": "number"
},
"mergeContiguous": {
"type": "boolean"
},
"prefix": {
"type": "string"
},
"postfix": {
"type": "string"
}
}
}
}
}
},
"sorting": {
"type" : "object",
"description": "Sorting options and defaults",
"required": [
"options"
],
"properties": {
"options": {
"type": "array",
"minItems": 1,
"items": {
"description": "Sorting options available for users to choose from",
"type": "object",
"required": [
"key",
"label",
"type",
"field",
"ascending"
],
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"type": {
"type": "string"
},
"field": {
"type": "string"
},
"ascending": {
"type": "boolean"
}
}
}
},
"defaults": {
"description": "Predefined sorting to execute by default",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"type": {
"type": "string"
},
"field": {
"type": "string"
},
"ascending": {
"type": "boolean"
}
}
}
}
}
},
"name": {
"description": "The name of search configuration",
"type": "string"
},
"default": {
"description": "Apply current search configuration by default",
"type": "boolean"
}
}
}
},
"type": "object",
@@ -1123,394 +1521,19 @@
}
},
"search": {
"description": "Search configuration parameters",
"type": "object",
"required": [
"categories"
],
"properties": {
"include": {
"anyOf": [
{
"description": "Search configuration",
"$ref": "#/definitions/search-configuration"
},
{
"type": "array",
"minItems": 1,
"description": "Multiple search configuration",
"items": {
"type": "string"
}
},
"fields": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"filterQueries": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"type": "string"
}
}
}
},
"filterWithContains": {
"type": "boolean"
},
"resetButton": {
"type": "boolean"
},
"facetFields": {
"type": "object",
"required": [
"fields"
],
"properties": {
"expanded": {
"description": "Toggles expanded state of the facet field",
"type": "boolean"
},
"fields": {
"description": "List of custom facet fields",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"field",
"mincount",
"label"
],
"properties": {
"field": {
"type": "string",
"description": "This specifies the facet field."
},
"mincount": {
"type": "number",
"description": "This specifies the minimum count required for a facet field to be included in the response. The default value is 1."
},
"label": {
"type": "string",
"description": "This specifies the label to include in place of the facet field."
},
"prefix": {
"type": "string",
"description": "This restricts the possible constraints to only indexed values with a specified prefix."
},
"limit": {
"type": "number",
"description": "Maximum number of results"
},
"pageSize": {
"type": "number",
"description": "Display page size"
},
"offset": {
"type": "integer"
}
}
}
}
}
},
"facetIntervals": {
"type": "object",
"required": [
"intervals"
],
"properties": {
"intervals": {
"description": "List of facet intervals",
"type": "array",
"items": {
"type": "object",
"required": [
"label",
"field",
"sets"
],
"properties": {
"label": {
"description": "This specifies the label to use to identify the field facet.",
"type": "string"
},
"field": {
"description": "This specifies the field to facet on.",
"type": "string"
},
"sets": {
"type": "array",
"items": {
"type": "object",
"required": [
"label",
"start",
"end"
],
"properties": {
"label": {
"description": "This specifies the label to use to identify the set.",
"type": "string"
},
"start": {
"description": "This specifies the start of the range.",
"type": "string"
},
"end": {
"description": "This specifies the end of the range.",
"type": "string"
},
"startInclusive": {
"description": "When true, the set will include values greater or equal to 'start'. The default value is true.",
"type": "boolean"
},
"endInclusive": {
"description": "When true, the set will include values less than or equal to 'end'. The default value is true.",
"type": "boolean"
}
}
}
},
"pageSize": {
"type": "number",
"description": "Display page size"
},
"mincount": {
"type": "number",
"description": "This specifies the minimum count required for a facet interval to be displayed. The default value is 1."
}
}
}
},
"expanded": {
"description": "Toggles expanded state of the facet intervals",
"type": "boolean"
}
}
},
"facetQueries": {
"type": "object",
"required": [
"label",
"queries"
],
"properties": {
"label": {
"description": "Label text for the default facet queries group",
"type": "string"
},
"pageSize": {
"description": "Default page size for the facet queries groups",
"type": "number"
},
"expanded": {
"description": "Toggles expanded state of the facet queries groups",
"type": "boolean"
},
"mincount": {
"description": "This specifies the minimum count required for a facet query to be displayed. The default value is 1.",
"type": "number"
},
"queries": {
"description": "List of custom facet queries",
"type": "array",
"items": {
"type": "object",
"required": [
"query",
"label"
],
"properties": {
"query": {
"type": "string"
},
"label": {
"description": "Unique identifier for the query",
"type": "string"
},
"group": {
"description": "The group that the facet query belongs to. If no group is defined, the facet query will appear under the default facet queries group label",
"type": "string"
}
}
}
}
}
},
"categories": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {},
"name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"expanded": {
"type": "boolean"
},
"component": {
"type": "object",
"required": [
"selector",
"settings"
],
"properties": {
"selector": {
"description": "Unique component runtime identifier",
"type": "string"
},
"settings": {
"description": "Component-specific settings",
"type": "object"
}
}
}
}
}
},
"highlight": {
"type": "object",
"description": " Request that highlight fragments to be added to result set rows The properties reflect SOLR highlighting parameters.",
"properties": {
"prefix": {
"description": "The string used to mark the start of a highlight in a fragment",
"type": "string"
},
"postfix": {
"description": "The string used to mark the end of a highlight in a fragment",
"type": "string"
},
"snippetCount": {
"description": "The maximum number of distinct highlight snippets to return for each highlight field",
"type": "number"
},
"fragmentSize": {
"description": "The character length of each snippet",
"type": "number"
},
"maxAnalyzedChars": {
"description": "The number of characters to be considered for highlighting. Matches after this count will not be shown",
"type": "number"
},
"mergeContiguous": {
"description": "If fragments over lap they can be merged into one larger fragment",
"type": "boolean"
},
"usePhraseHighlighter": {
"description": "Should phrases be identified",
"type": "boolean"
},
"fields": {
"type": "array",
"minItems": 1,
"items": {
"description": "The fields to highlight and field specific configuration properties for each field",
"type": "object",
"properties": {
"field": {
"description": "The name of the field to highlight",
"type": "string"
},
"snippetCount": {
"type": "number"
},
"fragmentSize": {
"type": "number"
},
"mergeContiguous": {
"type": "boolean"
},
"prefix": {
"type": "string"
},
"postfix": {
"type": "string"
}
}
}
}
}
},
"sorting": {
"type" : "object",
"description": "Sorting options and defaults",
"required": [
"options"
],
"properties": {
"options": {
"type": "array",
"minItems": 1,
"items": {
"description": "Sorting options available for users to choose from",
"type": "object",
"required": [
"key",
"label",
"type",
"field",
"ascending"
],
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"type": {
"type": "string"
},
"field": {
"type": "string"
},
"ascending": {
"type": "boolean"
}
}
}
},
"defaults": {
"description": "Predefined sorting to execute by default",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
"type": {
"type": "string"
},
"field": {
"type": "string"
},
"ascending": {
"type": "boolean"
}
}
}
}
"$ref": "#/definitions/search-configuration"
}
}
}
]
},
"adf-viewer": {
"description": "Viewer default properties",