Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The facet configuration for anything beyond "terms" doesn't align with the Globus Search API payloads. #251

Open
jbottigliero opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@jbottigliero
Copy link
Member

static.json Excerpt

      "globus": {
        "search": {
          "index": "c9f4e8ed-d9c3-47b1-9750-5e5f2d6ce3f7",
          "facets": [
            {
              "name": "Top Tags",
              "field_name": "tags",
              "type": "terms",
              "size": 25
            },
            {
              "name": "Pathogens",
              "field_name": "bio_annotations.pathogens",
              "type": "terms",
              "size": 25
            },
            {
              "name": "Year",
              "field_name": "citation.issued",
              "type": "date_histogram",
              "date_interval": "year"
            }
          ]
        }
      }

Encountered Error

This was being encountered on npm run docs, but would also be encountered on npm run build:

[info] Loaded plugin typedoc-plugin-markdown
[info] Loaded plugin typedoc-plugin-missing-exports
static.ts:163:14 - error TS2322: Type '{ _static: { generator: { name: string; }; }; data: { version: string; attributes: { metadata: { title: string; description: string; }; theme: { colorScheme: string; }; content: { logo: { src: string; alt: string; }; headline: string; }; components: { ...; }; globus: { ...; }; }; }; }' is not assignable to type 'Static'.
  Type '{ _static: { generator: { name: string; }; }; data: { version: string; attributes: { metadata: { title: string; description: string; }; theme: { colorScheme: string; }; content: { logo: { src: string; alt: string; }; headline: string; }; components: { ...; }; globus: { ...; }; }; }; }' is not assignable to type '{ data: Data; }'.
    The types of 'data.attributes.globus.search.facets' are incompatible between these types.
      Type '({ name: string; field_name: string; type: string; size: number; date_interval?: undefined; } | { name: string; field_name: string; type: string; date_interval: string; size?: undefined; })[]' is not assignable to type '{ name?: string | undefined; field_name: string; type: string; size: number; }[]'.
        Type '{ name: string; field_name: string; type: string; size: number; date_interval?: undefined; } | { name: string; field_name: string; type: string; date_interval: string; size?: undefined; }' is not assignable to type '{ name?: string | undefined; field_name: string; type: string; size: number; }'.
          Type '{ name: string; field_name: string; type: string; date_interval: string; size?: undefined; }' is not assignable to type '{ name?: string | undefined; field_name: string; type: string; size: number; }'.
            Types of property 'size' are incompatible.
              Type 'undefined' is not assignable to type 'number'.

163 export const STATIC: Static = _STATIC;
                 ~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant