Skip to content

Commit

Permalink
chore: algolia service turn off v2 (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava authored Dec 17, 2024
1 parent b4ac4c9 commit 7630b13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions servers/fdr/src/services/algolia/AlgoliaService.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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);
});
}
Expand Down

0 comments on commit 7630b13

Please sign in to comment.