Prepare a Vector Template for Fuzzy Search
Overview
By converting content into vector data, you can implement fuzzy search.
By utilizing the vector distance between search keywords and vectorized content, the content is responded in order of relevance.
This enables searches with variations in words used or searches based on text.
This document demonstrates fuzzy search on internal documents registered as content.
What You Will Learn
You will set up and verify the vector template using the following steps.
Prepare the Content
Enabling AI
Click on [AI/RAG] -> [Vector Data].
Enable "AI" and click [Update].
Creating the Content Structure
Register the content structure that will be the target for vector search.
Click [Add] on the Content structure list page.
Configure with the following details.
Configure the settings with the following details.
General
Field | Setting |
---|---|
Name | Internal Documents |
Field Settings
Field | Slug | Field Name | Field Setting |
---|---|---|---|
ext_1 | None | WYSIWYG | WYSIWYG |
Search Settings
Field | Setting |
---|---|
Convert to vector data | Enable |
Embedding model | text-embedding-3-small(OpenAI) |
Keyword template (AI/Vector) | Default |
Once the settings are done, click on [Add] to add the content structure.
Set Up the Vector Template
Template Verification
By default, the following templates are entered as conversion targets for vector data.
- topics_id
- slug
- Title
- Content
- Category
- Text part of all extension items
If you want to revert to the initial state, leaving it empty will automatically input the default template.
Modifying the Template
If you want to exclude specific items from the template or add related member information to the template, you can modify the template.
For this tutorial, we will proceed with the default settings.
Reference
The available variables are as follows.
Variable | Type | Description |
---|---|---|
$details | Object | Content details |
$ext_config | Object | Content extension settings |
The text output by Smarty notation becomes the vector template.
Please refer to the following document for examples of modifications.
Confirming the operation
Add content and check the search results from Swagger UI.
Adding the contents
Click on [Add] from the Content list screen.
Here, we have added the following 3 contents as examples.
Remote Work Guidelines
Employee Benefits Guidebook
Contact Information
Checking the vector template
In the editing screen of the added content, click the [More] button to display options.
By clicking on [Vector Template], you can check the output template.
The option for [Vector Template] will not be displayed until the reflection is complete.
You can check the template, summary, and index.
Preparing the vector search endpoint
Refer to the Endpoint Configuration Guide to create a vector search endpoint.
Set the path and model as follows:
- Path: vector_search
- Category: Content
- Model: Topics, v1
- Operation: list
- topics_group_id: 42 (ID assigned in Creating the content structure)
Checking in Swagger UI
Request the endpoint added with [Preparing the vector search endpoint] from the Swagger UI screen.
Enter Work from home
in the vector_search field and click Execute.
Although the term Work from home
is not registered in the content, the document related to Remote Work Guidelines with high relevance will be listed first in the response.
The vector_distance field represents the vector distance from the search string, and will be responded in ascending order of small values.
Related Documents
Support
If you have any other questions, please contact us or check out Our Slack Community.