evitaDB icon indicating copy to clipboard operation
evitaDB copied to clipboard

Support also distance `0` for specific queries

Open novoj opened this issue 1 year ago • 0 comments

Currently we don't allow to specify distance as zero, but there are use-cases where it makes sense. Consider following query:

query(
  collection("Product"),
  filterBy(
    hierarchyWithin(
      "categories",      
      attributeEquals(
        "code", "audio"    
      )
    )
  ),
  require(
    hierarchyOfReference(
      "categories",
      parents(
        "parentsWithSiblings",
        entityFetch(attributeContentAll()),
        siblings(
          entityFetch(attributeContentAll()),
          stopAt(            
            distance(1)
          )
        )
      )
    )
  )
)

We don't want siblings of nodes other than those in direct parent chain. Currently we don't have an option to do that.

novoj avatar Mar 27 '24 10:03 novoj