#community-help

Issues with `vector_query` request in Typesense

TLDR Gauthier struggles with a vector_query request in Typesense that gets stuck in sending state. Jason suggests an upgrade to 0.25.0.rc43, but docker container compatibility issues arise. Kishore Nallan has been tagged for assistance.

Powered by Struct AI
Jul 03, 2023 (5 months ago)
Gauthier
Photo of md5-41a2dfe6eee1bc76b6b4f1bb18d3b735
Gauthier
09:13 PM
Question wrt vector_query
I have this query:

curl --location 'https://MY_CLUSTER.typesense.net/multi_search?query_by=headline%2Cmerchant_name_dba%2Cmerchant_description' \
--header 'Content-Type: application/json' \
--header 'X-TYPESENSE-API-KEY: MY KEY' \
--data '{
    "searches": [
        {
            "collection": "triple_offers",
            "q": "*",
            "vector_query": "embeddings:([], id: triple_5296, k:25)"
        }
    ]
}'

and this schema (omitting some fields for brevity):
{
    "default_sorting_field": "amount",
    "enable_nested_fields": true,
    "fields": [
        {
            "facet": false,
            "index": false,
            "infix": false,
            "locale": "",
            "name": "triple_offer_id",
            "optional": true,
            "sort": true,
            "type": "int64"
        },
        {
            "facet": true,
            "index": true,
            "infix": false,
            "locale": "",
            "name": "merchant_name_dba",
            "optional": false,
            "sort": false,
            "type": "string"
        },
        {
            "facet": false,
            "index": true,
            "infix": false,
            "locale": "",
            "name": "headline",
            "optional": false,
            "sort": false,
            "type": "string"
        },
        {
            "facet": false,
            "index": true,
            "infix": false,
            "locale": "",
            "name": "amount",
            "optional": false,
            "sort": true,
            "type": "float"
        },
        {
            "facet": false,
            "index": true,
            "infix": false,
            "locale": "",
            "name": "merchant_description",
            "optional": false,
            "sort": false,
            "type": "string"
        },
        {
            "facet": false,
            "index": false,
            "infix": false,
            "locale": "",
            "name": "embeddings",
            "num_dim": 1536,
            "optional": true,
            "sort": false,
            "type": "float[]"
        }
    ],
    "name": "triple_offers",
    "symbols_to_index": [],
    "token_separators": []
}

and this would be, for example, the document to use for the k-nn
{
  "document": {
    "amount": 5,
    "embeddings": [1536 elements -- did not include for Slack],
    "headline": "5% back at Patron Mexican Grill Cranberry",
    "id": "triple_5296",
    "merchant_description": "Patron Mexican Grill is a locally-owned and business built by Martin Bolanos, who moved to the area from Michoacan, Mexico and opened the first Patron Mexican Grill in 2007. Today, with more locations than ever before, you'll find family traditions in everything from the decor and warm hospitality to the hand-crafted fare that's made from the finest ingredients. Showcasing dishes from all over Mexico, there's plenty on the menu to try. From favorites like cool and creamy guacamole to cheesy quesadillas, carnitas, burritos, seafood and steaks, there's lots on the menu. It's all made fresh and to-order, and with reasonable prices AND lunch specials, you can go anytime for a great meal. Also be sure to check out the cold beers and cocktails from the bar. With a large selection of tequilas, you can sip on all your favorites. It's always a fiesta at Patrons, check it out yourself today for a taste of Mexico!\r\n"
  }
}

My question:
When I try to send the query over Postman, it stays stuck at "Sending request". Whether I use a local instance or a Typesense Cloud instance.
Is it because my vector/embeddings field is too big?

Thank you!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:21 PM
Hmmm, this almost sounds like a bug. Could you try upgrading to 0.25.0.rc43 to see if that fixes the issue?
Gauthier
Photo of md5-41a2dfe6eee1bc76b6b4f1bb18d3b735
Gauthier
11:28 PM
Thanks Jason is there a docker container for arm64? I tried an upgrade 0.25.0.rc36 with arm64 but same behavior.
Otherwise I'll start the old intel machine tomorrow 😀. Thanks!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:29 PM
Kishore Nallan ^