github.com/weaviate/weaviate@v1.24.6/entities/vectorindex/hnsw/bq_config.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package hnsw
    13  
    14  import "github.com/weaviate/weaviate/entities/vectorindex/common"
    15  
    16  const (
    17  	DefaultBQEnabled = false
    18  )
    19  
    20  type BQConfig struct {
    21  	Enabled bool `json:"enabled"`
    22  }
    23  
    24  func parseBQMap(in map[string]interface{}, bq *BQConfig) error {
    25  	bqConfigValue, ok := in["bq"]
    26  	if !ok {
    27  		return nil
    28  	}
    29  
    30  	bqConfigMap, ok := bqConfigValue.(map[string]interface{})
    31  	if !ok {
    32  		return nil
    33  	}
    34  
    35  	if err := common.OptionalBoolFromMap(bqConfigMap, "enabled", func(v bool) {
    36  		bq.Enabled = v
    37  	}); err != nil {
    38  		return err
    39  	}
    40  
    41  	return nil
    42  }