public static Properties BuildPropertyMappings()

in Elastic.SemanticKernel.Connectors.Elasticsearch/ElasticsearchVectorStoreCollectionCreateMapping.cs [26:62]


    public static Properties BuildPropertyMappings(
        VectorStoreRecordPropertyReader propertyReader,
        Dictionary<VectorStoreRecordProperty, string> propertyToStorageName)
    {
        var propertyMappings = new Properties();

        var vectorProperties = propertyReader.VectorProperties;
        foreach (var property in vectorProperties)
        {
            propertyMappings.Add(propertyToStorageName[property],
                new DenseVectorProperty
                {
                    Dims = property.Dimensions,
                    Index = true,
                    Similarity = GetSimilarityFunction(property),
                    IndexOptions = new DenseVectorIndexOptions
                    {
                        Type = GetIndexKind(property)
                    }
                });
        }

        var dataProperties = propertyReader.DataProperties;
        foreach (var property in dataProperties)
        {
            if (property.IsFullTextSearchable)
            {
                propertyMappings.Add(propertyToStorageName[property], new TextProperty());
            }
            else if (property.IsFilterable)
            {
                propertyMappings.Add(propertyToStorageName[property], new KeywordProperty());
            }
        }

        return propertyMappings;
    }