Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typesense group_by working incorrect #1667

Open
quanleo94 opened this issue Apr 12, 2024 · 0 comments
Open

Typesense group_by working incorrect #1667

quanleo94 opened this issue Apr 12, 2024 · 0 comments

Comments

@quanleo94
Copy link

Description

Hey team,
I have a trouble with typesense api with group_by and I spent a lot of time but it work incorrect
I want to group_by data with geo type.
But it always return 1 coordinates

Steps to reproduce

  1. Create the schema
{
    "name": "shops",
    "fields": [
        {
            "name": "id",
            "type": "string",
            "facet": false
        },
        {
            "name": "category",
            "type": "string",
            "facet": false
        },
        {
            "name": "address",
            "type": "string",
            "facet": false
        },
        {
            "name": "coordinates",
            "type": "geopoint",
            "facet": true
        },
        {
            "name": "name",
            "type": "string",
            "facet": false
        },
        {
            "name": "description",
            "type": "string",
            "facet": false
        },
        {
            "name": "tags",
            "type": "string[]",
            "facet": true
        }
    ],
    "default_sorting_field": "priority",
    "searchable_fields": [
        "category",
        "location",
        "tags"
    ]
}
  1. Import data
"id","category","address","coordinates","name","description","tags"
"1", "funiture", "location1", [21.144536, 105.876222], "shop1", "shop1", ["funiture","chair"]
"2", "techology", "location1", [21.144536, 105.876222], "shop2", "shop2", ["iphone","ipad"]
"3", "techology", "location1", [21.153536, 105.816222], "shop3", "shop3", ["samsung","galaxy"]
"4", "techology", "location1", [21.167536, 105.854222], "shop4", "shop4", []
  1. Query data.
http://localhost:8108/collections/shops/documents/search?q=*&filter_by=coordinates:(21.144536, 105.876222, 100 km)&group_by=coordinates&per_page=250

Expected Behavior

I want to return data group by location.
Please help me group list location data
if have, only return list location group without hits response in group

Actual Behavior

Only return data with group_key 1 location is 21.144536, 105.876222

Metadata

Typesense Version: typesense/typesense 0.25.2 (docker image)

OS:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant