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

Collection metadata not returned by /collections or /collections/<name> #1699

Open
jackwilsdon opened this issue Apr 30, 2024 · 0 comments
Open
Labels

Comments

@jackwilsdon
Copy link

Description

The documentation for 26.0 indicates that metadata on a collection should be returned by GET /collections, however running the example in the documentation indicates this isn't the case.

Steps to reproduce

  1. $ curl --silent --verbose -X POST -H 'X-Typesense-API-Key: typesense' --data '{       
      "name": "docs",
      "enable_nested_fields": true,
      "fields": [
        {
          "name": "title",
          "type": "string",
          "facet": true
        }
      ],
      "metadata": {
        "batch_job": 325,
        "indexed_from": "2023-04-20T00:00:00.000Z"
      }
    }' localhost:8108/collections
    
    *   Trying [::1]:8108...
    * Connected to localhost (::1) port 8108
    > POST /collections HTTP/1.1
    > Host: localhost:8108
    > User-Agent: curl/8.4.0
    > Accept: */*
    > X-Typesense-API-Key: typesense
    > Content-Length: 240
    > Content-Type: application/x-www-form-urlencoded
    > 
    < HTTP/1.1 201 Created
    < Connection: keep-alive
    < access-control-allow-origin: *
    < content-type: application/json; charset=utf-8
    < transfer-encoding: chunked
    < 
    * Connection #0 to host localhost left intact
    {"created_at":1714484757,"default_sorting_field":"","enable_nested_fields":true,"fields":[{"facet":true,"index":true,"infix":false,"locale":"","name":"title","optional":false,"sort":false,"stem":false,"type":"string"}],"name":"docs","num_documents":0,"symbols_to_index":[],"token_separators":[]}
    
    Formatted response:
    {
      "created_at": 1714484757,
      "default_sorting_field": "",
      "enable_nested_fields": true,
      "fields": [
        {
          "facet": true,
          "index": true,
          "infix": false,
          "locale": "",
          "name": "title",
          "optional": false,
          "sort": false,
          "stem": false,
          "type": "string"
        }
      ],
      "name": "docs",
      "num_documents": 0,
      "symbols_to_index": [],
      "token_separators": []
    }
  2. $ curl --silent --verbose -H 'X-Typesense-API-Key: typesense' localhost:8108/collections
    
    *   Trying [::1]:8108...
    * Connected to localhost (::1) port 8108
    > GET /collections HTTP/1.1
    > Host: localhost:8108
    > User-Agent: curl/8.4.0
    > Accept: */*
    > X-Typesense-API-Key: typesense
    > 
    < HTTP/1.1 200 OK
    < Connection: keep-alive
    < access-control-allow-origin: *
    < content-type: application/json; charset=utf-8
    < transfer-encoding: chunked
    < 
    { [309 bytes data]
    * Connection #0 to host localhost left intact
    [{"created_at":1714484757,"default_sorting_field":"","enable_nested_fields":true,"fields":[{"facet":true,"index":true,"infix":false,"locale":"","name":"title","optional":false,"sort":false,"stem":false,"type":"string"}],"name":"docs","num_documents":0,"symbols_to_index":[],"token_separators":[]}]
    
    Formatted response:
    [
      {
        "created_at": 1714484757,
        "default_sorting_field": "",
        "enable_nested_fields": true,
        "fields": [
          {
            "facet": true,
            "index": true,
            "infix": false,
            "locale": "",
            "name": "title",
            "optional": false,
            "sort": false,
            "stem": false,
            "type": "string"
          }
        ],
        "name": "docs",
        "num_documents": 0,
        "symbols_to_index": [],
        "token_separators": []
      }
    ]
    

Expected Behavior

The collection's metadata should be returned in GET /collections (or GET /collections/<name>).

Actual Behavior

The collection's metadata is not returned.

Metadata

Typesense Version: 26.0

OS: Docker on macOS, typesense/typesense:26.0 image

@kishorenc kishorenc added the bug label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants