@@ -128,28 +128,34 @@ def get_semantic_search(self) -> SemanticSearch:
128
128
Returns:
129
129
SemanticSearch: The semantic search configuration"""
130
130
131
- @abstractmethod
132
131
def get_skills (self ) -> list :
133
132
"""Get the skillset for the indexer.
134
133
135
134
Returns:
136
135
list: The skillsets used in the indexer"""
137
136
138
- @abstractmethod
137
+ return []
138
+
139
139
def get_indexer (self ) -> SearchIndexer :
140
140
"""Get the indexer for the indexer."""
141
141
142
- @abstractmethod
142
+ return None
143
+
143
144
def get_index_projections (self ) -> SearchIndexerIndexProjections :
144
145
"""Get the index projections for the indexer."""
145
146
147
+ return None
148
+
146
149
def get_synonym_map_names (self ) -> list [str ]:
147
150
"""Get the synonym map names for the indexer."""
148
151
return []
149
152
150
153
def get_data_source (self ) -> SearchIndexerDataSourceConnection :
151
154
"""Get the data source for the indexer."""
152
155
156
+ if self .get_indexer () is None :
157
+ return None
158
+
153
159
data_deletion_detection_policy = NativeBlobSoftDeleteDeletionDetectionPolicy ()
154
160
155
161
data_change_detection_policy = HighWaterMarkChangeDetectionPolicy (
@@ -464,6 +470,12 @@ def deploy_index(self):
464
470
def deploy_skillset (self ):
465
471
"""This function deploys the skillset."""
466
472
skills = self .get_skills ()
473
+
474
+ if len (skills ) == 0 :
475
+ logging .warning ("No skills defined. Skipping skillset deployment." )
476
+
477
+ return
478
+
467
479
index_projections = self .get_index_projections ()
468
480
469
481
skillset = SearchIndexerSkillset (
@@ -481,6 +493,11 @@ def deploy_data_source(self):
481
493
"""This function deploys the data source."""
482
494
data_source = self .get_data_source ()
483
495
496
+ if data_source is None :
497
+ logging .warning ("Data source not defined. Skipping data source deployment." )
498
+
499
+ return
500
+
484
501
result = self ._search_indexer_client .create_or_update_data_source_connection (
485
502
data_source
486
503
)
@@ -491,6 +508,11 @@ def deploy_indexer(self):
491
508
"""This function deploys the indexer."""
492
509
indexer = self .get_indexer ()
493
510
511
+ if indexer is None :
512
+ logging .warning ("Indexer not defined. Skipping data source deployment." )
513
+
514
+ return
515
+
494
516
result = self ._search_indexer_client .create_or_update_indexer (indexer )
495
517
496
518
logging .info ("%s indexer created" , result .name )
0 commit comments