admin管理员组

文章数量:1123262

I have a container named 'vectormodels', which holds items of type BgBomVectorModel. My task is to return an array of BgBomVectorItem. Each model comprises 200 BgBomVectorItem elements, and the container contains 1000 models in total. I know the specific models I need since my client will select a model by its ID. However, they only require 5 or 6 BgBomVectorItem elements from the selected model. Therefore, I need to perform a vector search within the array.

  • We have a lot of examples vector search container collection. But not inside object
  • I'm using Semantic Kernel.
  • I suspect the issue lies with the Indexing Policy.
    public class BgBomVectorModel
    {
        [VectorStoreRecordKey]
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; } //<- will select by id

       
        public List<BgBomVectorItem> BomItemsInformation { get; set; } //<-  For this need Vectore  Search   
    }

    public class BgBomVectorItem
    {
        [VectorStoreRecordKey]
        public string id { get; set; }

        [VectorStoreRecordData(IsFullTextSearchable = true)]
        public string Information { get; set; }
        //Vector Embedding
        [VectorStoreRecordVector(4, DistanceFunction.EuclideanDistance, IndexKind.Flat)]
        public ReadOnlyMemory<float> DescriptionEmbedding { get; set; }
    }

I have attempted to perform a vector search within a CosmosDB container, specifically searching within the array of BgBomVectorItem elements inside each BgBomVectorModel. However, most of the examples I've found so far only show vector search within container collections, not inside objects like in my case. I was expecting to retrieve a subset of BgBomVectorItem elements (5 or 6 items) from a specific model based on its ID, but it seems that the current indexing policy might be preventing the search from working correctly within the objects.

本文标签: cHow can I perform a vector search in CosmosDB using an array of objectsStack Overflow