typesense icon indicating copy to clipboard operation
typesense copied to clipboard

[BUG] Field `embedding` does not have a vector query index `29.0.rc23`

Open guidedways opened this issue 6 months ago • 2 comments

I'm using typesense/typesense:29.0.rc23 with Docker. Here's the relevant part of my schema:

        {
            name: 'embedding',
            type: 'float[]',
            optional: true,
            vector_query: true,
            num_dims: 1536   // OpenAI ada-002 embeddings have 1536 dimensions
        },

After updating embeddings manually via OpenAI API, I have confirmed that embeddings exist:

docker run --rm --network com_app-network curlimages/curl -s -H "X-TYPESENSE-API-KEY: XXXXXXX"    …
      "http://typesense:8108/collections/docs/documents/search?q=*&per_page=1&include_fields=document_id,section_title,embedding"

Results:

{"facet_counts":[],"found":7,"hits":[{"document":{"document_id":"section__docs_busycal_70588_week_view_h1","embedding":[-0.0035312161780893803,-0.002517839428037405,0.016397982835769653,-0.02618684247136116,-0.

Our search query is:

search-proxy-1    | Search URL: http://typesense:8108/multi_search
search-proxy-1    | Search request body (sanitized): {
search-proxy-1    |   searches: [
search-proxy-1    |     {
search-proxy-1    |       collection: 'docs',
search-proxy-1    |       q: "Some long snipper comes here",
search-proxy-1    |       per_page: '3',
search-proxy-1    |       filter_by: '',
search-proxy-1    |       facet_by: '',
search-proxy-1    |       highlight_start_tag: '<mark>',
search-proxy-1    |       highlight_end_tag: '</mark>',
search-proxy-1    |       include_fields: 'section_title,page_url,section_link,normalized_url,section_level,breadcrumb_path,parent_section,*snippet*',
search-proxy-1    |       include_fields_in_group_hits: 'true',
search-proxy-1    |       prioritize_proximity: 'true',
search-proxy-1    |       proximity_score_threshold: '0.75',
search-proxy-1    |       sort_by: '_text_match:desc,popularity:desc',
search-proxy-1    |       query_by: 'embedding,section_title,section_keywords,section_link,section_content',
search-proxy-1    |       exclude_fields: 'embedding,section_content,section_keywords',
search-proxy-1    |       enable_vector_search: 'true',
search-proxy-1    |       rerank_hybrid_matches: 'true',
search-proxy-1    |       include_snippet: 'true',
search-proxy-1    |       snippet_threshold: '5',
search-proxy-1    |       snippet_fields: 'section_content,section_title',
search-proxy-1    |       highlight_full_fields: 'section_title',
search-proxy-1    |       highlight_fields: 'section_title,section_content',
search-proxy-1    |       highlight_affixes_num_tokens: '15',
search-proxy-1    |       snippet_max_tokens: '60',
search-proxy-1    |       max_candidates: '40',
search-proxy-1    |       exhaustive_search: 'true',
search-proxy-1    |       prefix: 'false',
search-proxy-1    |       typo_tokens_threshold: '1',
search-proxy-1    |       num_typos: '1',
search-proxy-1    |       prioritize_exact_match: 'true',
search-proxy-1    |       id: "query_1747743967681",
search-proxy-1    |       vector_query: 'embedding:([-0.0392684,-0.02238762,0.021731433,-0.02779153,0.0006284456,...truncated...], alpha: 0.8)'
search-proxy-1    |     }
search-proxy-1    |   ]
search-proxy-1    | }

However this results in an error:

{
    "code": 400,
    "error": "Field `embedding` does not have a vector query index.",
    "semanticSearch": true,
    "semanticWeight": 0.4
}

I just can't get it to work. It worked once at some point but since then I've tried every combination of parameters but I get the same error.

guidedways avatar May 20 '25 12:05 guidedways

num_dims had to be changed to → num_dim 🤦‍♂️

guidedways avatar May 20 '25 14:05 guidedways

It would be nice for the server to point these out somehow, don't know why I read it as num_dims in the docs. Had to compare my config character to character before figuring this one out.

guidedways avatar May 20 '25 14:05 guidedways