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

Issue #20: add dynamic fields #41

Merged
merged 10 commits into from
Dec 28, 2023
Merged

Issue #20: add dynamic fields #41

merged 10 commits into from
Dec 28, 2023

Conversation

idrissneumann
Copy link
Collaborator

No description provided.

@idrissneumann idrissneumann force-pushed the feat_aggregation_filter branch from 0e9705d to 881e3e9 Compare December 27, 2023 18:11
@idrissneumann idrissneumann changed the title Issue #20: add TODO Issue #20: add dynamic fields Dec 27, 2023
@idrissneumann idrissneumann force-pushed the feat_aggregation_filter branch from 881e3e9 to f3b7750 Compare December 27, 2023 18:12
@idrissneumann idrissneumann marked this pull request as ready for review December 27, 2023 19:27
@idrissneumann
Copy link
Collaborator Author

@fmassot At this stage, seems working:

Screenshot 2023-12-27 at 20 27 12

I add a filter on aggregatable: true and the update the typeMap with the types defined in the elasticsearch documentation which are corresponding to the types returned by the /_field_caps endpoint:

$ curl http://localhost:7280/api/v1/_elastic/yoi/_field_caps
{
  "indices": [
    "yoi"
  ],
  "fields": {
    "timestamp": {
      "date_nanos": {
        "metadata_field": false,
        "searchable": true,
        "aggregatable": true,
        "type": "date_nanos",
        "indices": [
          "yoi"
        ]
      }
    },
    "yo": {
      "text": {
        "metadata_field": false,
        "searchable": true,
        "aggregatable": false,
        "type": "text",
        "indices": [
          "yoi"
        ]
      },
      "keyword": {
        "metadata_field": false,
        "searchable": true,
        "aggregatable": false,
        "type": "keyword",
        "indices": [
          "yoi"
        ]
      }
    },
    "_field_presence": {
      "long": {
        "metadata_field": false,
        "searchable": true,
        "aggregatable": false,
        "type": "long",
        "indices": [
          "yoi"
        ]
      }
    }
  }
}

src/datasource.ts Outdated Show resolved Hide resolved
src/datasource.ts Outdated Show resolved Hide resolved
@fmassot
Copy link
Contributor

fmassot commented Dec 28, 2023

@idrissneumann I declared explicit types for field capabilities, can you check my last modifications?

@idrissneumann
Copy link
Collaborator Author

@idrissneumann I declared explicit types for field capabilities, can you check my last modifications?

Yeah, nice refactoring, it's a better version with explicit types for sure.

I made two changes:

  • Rollback on the docker-compose.yml because of the pipeline error docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings here
  • Remove an old block of commented code which refer to the getField function which doesn't exists anymore

The tests are still ok though so LGTM for me :)

src/datasource.ts Outdated Show resolved Hide resolved
@idrissneumann idrissneumann force-pushed the feat_aggregation_filter branch from 89ce47f to debd8ae Compare December 28, 2023 10:47
@idrissneumann idrissneumann merged commit dac4ba6 into main Dec 28, 2023
2 checks passed
@guilload guilload deleted the feat_aggregation_filter branch March 12, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants