Skip to content

semantic score not generated when sending a query using vectorstore.similarity_search method  #962

Closed
@AhmedMostafa08

Description

@AhmedMostafa08

Description
when trying to send a query using vectorstore.similarity_search i get a KeyError: '_semanticScore' as the result doesn't have a semantic score generated
semantic_score = result["_semanticScore"]

Expected behavior
to get a response

Current behavior
the mentioned error happens

here's the code for how I created the vector index :
client=meilisearch.Client('url','api key ')
embeddings = OpenAIEmbeddings()
vectorstore = Meilisearch(
embedding=embeddings,
client=client,
embedders=embedders,
index_name='vector_index')
and here's the embedding and embedder code
embeddings = OpenAIEmbeddings()
embedders = {
"default": {
"source": "userProvided",
"dimensions": 1536,
}
}
embedder_name = "default"

also note that the vector store is created and documents are added just fine
and here's an example for the indexed document
Document(page_content="name: MA in Sport Management\ncities: ['Southampton']\ncountries: ['United Kingdom']\ncontinents: ['Europe']\nei: Solent University\nmajors: ['Sports Management']\nminors: ['Sport and Fitness Management']\ndegree_level: Masters\nid: 470849\nis_featured: False\nint_fee_currency: USD\ntuition_fee_type: absolute\nslug: ma-in-sport-management\nboosted: 299995\nphoto: https://active-storage-assets.s3.eu-west-1.amazonaws.com/3t4naBgJWYSZqr8DZrg4GkAY\npartnership_boost: 49926\npartnership_type: Recruitment Solution\neasy_apply: True\nprogram_ranking: None\nei_global_ranking: 74\nei_country_ranking: 93\nleads_subscription: 0\nvisits_subscription: 0\ntotal_tuition_fee: 18352.0\nprogram_level_id: 71\nparent_degree_level_id: 2770\ncity_ids: [30580]\ncountry_ids: [75]\nmajor_ids: [2846]\nint_tuition_fees: 18352.0\ntuition_fees: 10,000 - 20,000\nduration_in_days: 365\napplication_deadlines: [1688774400]\nei_id: 36943\npersuasion_text: None\nintakes: ['Winter 2023', 'Fall 2023', 'Winter 2024']\nduration: Less than 2 years\nparent_degree_level: Masters\nformat: Full time\nstudy_type: ['On campus']\ndiscipline: {'lvl0': ['Business & Management'], 'lvl1': ['Business & Management > Sports Management']}\npage_content: name: MA in Sport Management\ncities: ['Southampton']\ncountries: ['United Kingdom']\ncontinents: ['Europe']\nei: Solent University\nmajors: ['Sports Management']\nminors: ['Sport and Fitness Management']\ndegree_level: Masters\nid: 470849\nis_featured: False\nint_fee_currency: USD\ntuition_fee_type: absolute\nslug: ma-in-sport-management\nboosted: 299995\nphoto: https://active-storage-assets.s3.eu-west-1.amazonaws.com/3t4naBgJWYSZqr8DZrg4GkAY\npartnership_boost: 49926\npartnership_type: Recruitment Solution\neasy_apply: True\nprogram_ranking: None\nei_global_ranking: 74\nei_country_ranking: 93\nleads_subscription: 0\nvisits_subscription: 0\ntotal_tuition_fee: 18352.0\nprogram_level_id: 71\nparent_degree_level_id: 2770\ncity_ids: [30580]\ncountry_ids: [75]\nmajor_ids: [2846]\nint_tuition_fees: 18352.0\ntuition_fees: 10,000 - 20,000\nduration_in_days: 365\napplication_deadlines: [1688774400]\nei_id: 36943\npersuasion_text: None\nintakes: ['Winter 2023', 'Fall 2023', 'Winter 2024']\nduration: Less than 2 years\nparent_degree_level: Masters\nformat: Full time\nstudy_type: ['On campus']\ndiscipline: {'lvl0': ['Business & Management'], 'lvl1': ['Business & Management > Sports Management']}", metadata={'source': 'https://www.educatly.com/program/470849')

  • Meilisearch version: 1.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions