You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we add return_properties (or we could call it include_properties) to aggregate.near_x queries, like this:
response=artworks.aggregate.near_text(
query="red furniture",
object_limit=200,
group_by=GroupByAggregate(
prop="type", limit=3
),
# proposal to add `return_properties`return_properties=[
"name",
"price",
"type"# yes, it should be possible to return the group_by value as well
]
)
Then we should be able to access each group and their underlying objects (with the selected properties) like this:
forgroupinresponse.groups:
foritemingroup.objects:
print(item.properties) # access the requested propertiesprint(item.id) # access the object id, it should be there by default
Describe your feature request
Hi there,
It would be great to run an aggregate query and return a selection of properties for matched objects within each group.
For example, if we have a collection of shopping items, like:
It should be possible to search for "red furniture" and get back something like:
Proposal
Can we add
return_properties
(or we could call itinclude_properties
) toaggregate.near_x
queries, like this:Then we should be able to access each group and their underlying objects (with the selected properties) like this:
The current workaround
Currently, we can use:
or
However, there is no way to get the required properties together - as in, we can't get the name+description together.
Also, the code access these properties is not the most elegant, and in this case we are not interested in how many times that value occurs:
Code of Conduct
The text was updated successfully, but these errors were encountered: