https://github.com/hzik/Searchable-text
https://github.com/hzik/Searchable-text
kontent-ai kontent-ai-custom-elements kontent-ai-integration
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hzik/Searchable-text
- Owner: hzik
- Created: 2024-03-06T11:40:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T14:11:27.000Z (over 2 years ago)
- Last Synced: 2024-07-29T19:08:07.518Z (almost 2 years ago)
- Topics: kontent-ai, kontent-ai-custom-elements, kontent-ai-integration
- Language: HTML
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Searchable text
With this custom element you can search by words in your Text elements.
## Setup
1. Deploy the code to a secure public host
* See [deploying section](#Deploying) for a really quick option
2. Configure Custom element in Kontent.ai UI
* The `Hosted code URL` is where you deployed to in step 1
* `Allow the custom element to read values of specific elements` select the text you would like to index
* `JSON parameters`:
```json
{
"source_text": "codename_of_text_element"
}
```
## Deploying
Netlify has made this easy. If you click the deploy button below, it will guide you through the process of deploying it to Netlify and leave you with a copy of the repository in your GitHub account as well.
[](https://app.netlify.com/start/deploy?repository=https://github.com/hzik/Searchable-text)
## What is Saved?
```json
"indexed_text": {
"type": "custom",
"name": "Indexed text",
"value": "[\"Hi\",\"how\",\"are\",\"you\"]"
}
```
## Searching by indexed text
You can use `Contains` filter to find the item you need:
`/items?elements.indexed_text[contains]=word`