Issue with group by using python client

I am trying to return objects grouped by a simple field and have had no luck. Any variation I have tried always seems to essentially ignore the group by and return according to the rest of the query. The “_additional” field is returned as None. What am I missing?


result = client.query.get("Chunks", ["text"]) \
    .with_bm25(query="what is cybersecurity") \
    .with_group_by(["page"],groups=2,objects_per_group=2) \
    .with_additional(
	
	"""
	group {
            id
            groupedBy {
                path
                value
            }
            count
			}
			
			"""
	) \
    .with_limit(10) \
    .do()

Hi! Welcome to our community! :hugs:

Indeed, I was only able to use group by using the near text (similarity search). Check this notebook out:

I have forwarded this question internally, and will get back here when I have more info.

Thanks!

Hi! Sorry for the delay here.

Indeed, group by will only work when used with with_near_text

Thanks!