github.com/weaviate/weaviate@v1.24.6/adapters/repos/db/refcache/group_properties_util.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 refcache
    13  
    14  import (
    15  	"strings"
    16  
    17  	"github.com/weaviate/weaviate/entities/search"
    18  )
    19  
    20  func getGroupSelectProperties(properties search.SelectProperties) search.SelectProperties {
    21  	var selectGroupHitsProperties search.SelectProperties
    22  	for _, prop := range properties {
    23  		if strings.HasPrefix(prop.Name, "_additional:group:hits") {
    24  			selectGroupHitsProperties = append(selectGroupHitsProperties, search.SelectProperty{
    25  				Name:            strings.Replace(prop.Name, "_additional:group:hits:", "", 1),
    26  				IsPrimitive:     prop.IsPrimitive,
    27  				IncludeTypeName: prop.IncludeTypeName,
    28  				Refs:            prop.Refs,
    29  			})
    30  		}
    31  	}
    32  	return selectGroupHitsProperties
    33  }