diff --git a/servers/fdr/src/services/algolia/AlgoliaService.ts b/servers/fdr/src/services/algolia/AlgoliaService.ts index 87dac96652..a4685b3f88 100644 --- a/servers/fdr/src/services/algolia/AlgoliaService.ts +++ b/servers/fdr/src/services/algolia/AlgoliaService.ts @@ -1,6 +1,7 @@ import { APIV1Db, DocsV1Db } from "@fern-api/fdr-sdk"; import algolia, { type SearchClient } from "algoliasearch"; import { type FdrApplication } from "../../app"; +import { AlgoliaSearchRecordGenerator } from "./AlgoliaSearchRecordGenerator"; import { AlgoliaSearchRecordGeneratorV2 } from "./AlgoliaSearchRecordGeneratorV2"; import type { AlgoliaSearchRecord, ConfigSegmentTuple } from "./types"; @@ -51,14 +52,13 @@ export class AlgoliaServiceImpl implements AlgoliaService { configSegmentTuples: ConfigSegmentTuple[]; }) { return configSegmentTuples.flatMap(([config, indexSegment]) => { - const generator = new AlgoliaSearchRecordGeneratorV2({ docsDefinition, apiDefinitionsById }); + const generator = new ( + url.includes("workato") ? AlgoliaSearchRecordGeneratorV2 : AlgoliaSearchRecordGenerator + )({ docsDefinition, apiDefinitionsById }); if (config == null) { return []; } - // const generator = getConfig().algoliaSearchV2Domains.some((domains) => url.includes(domains)) - // ? new AlgoliaSearchRecordGeneratorV2({ docsDefinition, apiDefinitionsById }) - // : new AlgoliaSearchRecordGenerator({ docsDefinition, apiDefinitionsById }); return generator.generateAlgoliaSearchRecordsForSpecificDocsVersion(config, indexSegment); }); }