|
@@ -531,11 +531,21 @@ class OpenSearchService
|
|
|
* @return string|null 形如 "analysis/pali-synonyms-20260731.txt",未设置时返回 null
|
|
* @return string|null 形如 "analysis/pali-synonyms-20260731.txt",未设置时返回 null
|
|
|
*/
|
|
*/
|
|
|
public function getPaliSynonymsPath(): ?string
|
|
public function getPaliSynonymsPath(): ?string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->getPaliSynonymsSetting()['synonyms_path'] ?? null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 读取当前索引 pali_synonyms filter 的完整设置
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return array{type?: string, synonyms_path?: string, updateable?: string}|null 未设置时返回 null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getPaliSynonymsSetting(): ?array
|
|
|
{
|
|
{
|
|
|
$index = config('mint.opensearch.index');
|
|
$index = config('mint.opensearch.index');
|
|
|
$settings = $this->client->indices()->getSettings(['index' => $index]);
|
|
$settings = $this->client->indices()->getSettings(['index' => $index]);
|
|
|
|
|
|
|
|
- return $settings[$index]['settings']['index']['analysis']['filter']['pali_synonyms']['synonyms_path'] ?? null;
|
|
|
|
|
|
|
+ return $settings[$index]['settings']['index']['analysis']['filter']['pali_synonyms'] ?? null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|