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

[Feature Request]: Supports Binary vector with Hamming distance. #2069

Open
1 task done
vsian opened this issue Oct 18, 2024 · 0 comments
Open
1 task done

[Feature Request]: Supports Binary vector with Hamming distance. #2069

vsian opened this issue Oct 18, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@vsian
Copy link
Contributor

vsian commented Oct 18, 2024

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

No response

Describe the feature you'd like

Support hamming distance as metric when matching binary vectors.
The desired statement:

SELECT c1 FROM binaries SEARCH MATCH VECTOR (c2, [1, 1, 0, 0, 0, 1, 1, 1], 'bit', 'hamming', 3);

Describe implementation you've considered

No response

Documentation, adoption, use case

No response

Additional information

No response

@vsian vsian added the feature request New feature or request label Oct 18, 2024
JinHai-CN pushed a commit that referenced this issue Oct 22, 2024
### What problem does this PR solve?

Support hamming distance as metric when matching binary vectors.

Issue link: #2069 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Test cases
JinHai-CN pushed a commit that referenced this issue Oct 24, 2024
### What problem does this PR solve?

Support matching binary vectors with hamming distance in infinity
sdk(remote and embedded) and http.

SDK:
```python
res = table_obj.output(["*", "_distance"]).match_dense("c2", [0] * 16, "bit", "hamming", 3).to_df()
```

HTTP:
```bash
curl --request GET \
    --url http://localhost:23820/databases/default_db/tables/test_binary_hamming/docs \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data ' 
    {
        "output":
        [
            "*",
            "_distance"
        ],
        "search":
        [
            {
                "match_method": "dense",
                "fields": "c2",
                "query_vector": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                "element_type": "bit",
                "metric_type": "hamming",
                "topn": 3
            }
        ]
    } '
```

Issue link: #2069 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Python SDK impacted, Need to update PyPI
@yingfeng yingfeng mentioned this issue Oct 25, 2024
93 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant