File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 77 SearchableField ,
88 SimpleField ,
99 ComplexField ,
10+ SemanticField ,
11+ SemanticPrioritizedFields ,
12+ SemanticConfiguration ,
13+ SemanticSearch ,
1014)
1115from ai_search import AISearch
1216from environment import (
@@ -107,3 +111,22 @@ def get_index_fields(self) -> list[SearchableField]:
107111 ]
108112
109113 return fields
114+
115+ def get_semantic_search (self ) -> SemanticSearch :
116+ """This function returns the semantic search configuration for sql index
117+
118+ Returns:
119+ SemanticSearch: The semantic search configuration"""
120+
121+ semantic_config = SemanticConfiguration (
122+ name = self .semantic_config_name ,
123+ prioritized_fields = SemanticPrioritizedFields (
124+ content_fields = [
125+ SemanticField (field_name = "Question" ),
126+ ],
127+ ),
128+ )
129+
130+ semantic_search = SemanticSearch (configurations = [semantic_config ])
131+
132+ return semantic_search
You can’t perform that action at this time.
0 commit comments