meetnearme / api

1 stars 0 forks source link

Update schema to new marqo-indexed fields, move `purchasable` & `registrationFields` out of event schema #123

Closed brianfeister closed 2 months ago

brianfeister commented 2 months ago

I'm implementing Marqo, which means we want this data to be fast and light, focusing only on what we want to index on. Fortunately, both purchasable and also registrationFields are data calls that we can resolve async (either via HTMX on load, or via templ http streaming if Lambda API Gateway allows it) so we want to move those out.

Also some adjustments are made based on the following marqo index configuration:


{
  "type": "structured",
  "vectorNumericType": "float",
  "model": "hf/bge-large-en-v1.5",
  "normalizeEmbeddings": true,
  "textPreprocessing": {
    "splitLength": 2,
    "splitOverlap": 0,
    "splitMethod": "sentence"
  },
  "imagePreprocessing": {
    "patchMethod": null
  },
  "annParameters": {
    "spaceType": "prenormalized-angular",
    "parameters": {
      "efConstruction": 512,
      "m": 16
    }
  },
  "tensorFields": ["name_description_address"],
  "allFields": [
    {
      "name": "name_description_address",
      "type": "multimodal_combination",
      "dependentFields": {"name": 0.3, "address": 0.2, "description": 0.5}
    },
    {"name": "eventOwners", "type": "text", "features": ["filter", "lexical_search"]},
    {"name": "tags", "type": "text", "features": ["filter", "lexical_search"]},
    {"name": "categories", "type": "text", "features": ["filter", "lexical_search"]}
  ]
}