Eugenio Romano ee27271776
Improve documentation extension (#2266)
* improve documentation step 1

* improve documentation step 2

* improve documentation step 3

* move in tutorials

* tutotrials

* fix

* fix

* fix

* fix links

* metadata extension configutation

* tutorials links revamp
2021-08-26 11:52:57 +02:00

83 lines
2.5 KiB
Markdown

---
Title: Search Form
---
## Custom search form
From version 2.5.0 ACA search support multiple search configurations.
In this tutorial, we are going to implement the following features:
- [Add a new search form](#add-a-new-search-form)
- [Replace a search form](#replace-a-search-form)
- [Replace default search](#replace-default-search)
### Extension Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| id | `string` | | Unique identifier of the search |
| name | `string` | "" | Display title of the form |
| order | `string` | | Visualization order in the dropdown |
| default | `boolean` | | if the search has to be used as default search |
| aca:fields| `string[]`| | list of aspects property to add in the query and search in the value for the given text. The property will be concatenated in AND|
### Search configuration properties
In order to learn more about :
-The search UI configuration possibilities refer to the [ADF Search configuration documentation](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/docs/user-guide/search-configuration-guide.md)
-The search Query configuration possibilities refer to the [Full text search reference documentation](https://docs.alfresco.com/search-services/latest/using/)
### Add a new search form
Update `your-app.extensions.json` file, and insert a new entry to the `features.search` section:
```json
{
"features": {
"search": [
{
"id": "app.search.custom_search",
"order": 200,
"name": "APP.SEARCH.MY_CUSTOM_SEARCH",
"default": false,
"aca:fields": [ "cm:name", "cm:title", "cm:description", "TEXT", "TAG"],
"filterQueries": [
{
"query": "+ASPECT: 'cm:person'"
}
]
}
]
}
}
```
Note that the entries of the filterQueries array are joined using the AND operator.
### Replace a search form
To replace an already present search form you need to add a new search configuration with the same `id` of an already present configuration
### Replace default search
To replace the default search with your configuration set to true the default field
```json
{
"features": {
"search": [
{
"id": "app.search.custom_search",
"order": 200,
"name": "APP.SEARCH.MY_CUSTOM_SEARCH",
"default": true,
"aca:fields": [ "cm:name", "cm:title", "cm:description", "TEXT", "TAG"],
"filterQueries": [
{
"query": "+ASPECT: 'cm:person'"
}
]
}
]
}
}
```