@playlive/tiltify-search
    Preparing search index...

    Class CampaignSearch

    Search wrapper for the Tiltify facts Meilisearch index, with a special CampaignSearch.getAllCampaigns method that transparently works around the maxTotalHits cap by recursively partitioning the filter along facetable axes until each leaf bucket is under the cap.

    import { CampaignSearch } from "@playlive/tiltify-search";

    const cs = new CampaignSearch();
    const page = await cs.getCampaigns({
    page: 1,
    hitsPerPage: 20,
    filter: { type: "campaign", public: true },
    query: "marathon",
    });

    https://site-search.tiltify.com — index host.

    Index
    client: MeiliSearch
    index: Index<FactHit>
    • Fetch every campaign matching filter, transparently working around the Meilisearch maxTotalHits cap by recursively partitioning the filter along facetable axes until each leaf bucket is under the cap.

      When filter.type is omitted, results are constrained to CAMPAIGN_FACT_TYPES (campaign + team_event). The facts index also contains causes, fundraising events, users, teams, and auction houses; without this default they would leak into the result set. Pass an explicit type to override.

      Progress can be observed via the optional onProgress callback. The total is determined from a facet count up front and stays fixed for the duration of the call; collected grows monotonically.

      Sibling probes and leaf fetches run in parallel, bounded by options.concurrency (default 4).

      Parameters

      Returns Promise<FactHit[]>

      Every unique hit (deduped by id).

      const all = await cs.getAllCampaigns(
      { public: true, type: "campaign" },
      ({ collected, total }) => console.log(`${collected}/${total}`),
      );
    • Plain Meilisearch search call. Forwards filter (via buildFilterString) and pagination directly to the index.

      Parameters

      • __namedParameters: { filter?: FilterableFields; hitsPerPage: number; page: number; query?: string }

      Returns Promise<
          SearchResponse<
              FactHit,
              {
                  attributesToHighlight: string[];
                  filter: string;
                  hitsPerPage: number;
                  page: number;
                  totalHits?: number;
              },
          >,
      >

      await cs.getCampaigns({ page: 1, hitsPerPage: 20, filter: { type: "campaign" } });