Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Filtering json strings

Đang mở
#32 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
search

Hướng nghiên cứu

Start by reproducing the filter_by query against the shown schema fields and Typesense version 0.15.0, focusing on the first_data and second_data JSON strings and the some_field array. Determine whether the behavior comes from the filter expression or string representation, then verify the expected result of matching records where either JSON field has a value.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

I have two string fields that are part of my filter_by query: first_data and second_data. Either of these fields can have a value or none of them. Their values are set by encoding a Python dictionary to a json string e.g

first_dict = {'age':40}
second_dict = {}

first_data = json.dumps(first_dict, default=str)
second_data = json.dumps(first_dict, default=str)

Steps to reproduce

schema_fields = [
        {
            "name": "first_data", "type": "string",
        },
        {
            "name": "second_data", "type": "string"
        },
        {
            "name": "some_field", "type": "string[]"
        }
]

# Note that I am only checking for emptiness in both fields. There is probably a better approach for this by I wonder this doesn't work

{
  "q": "*",
  "filter_by": "first_data:!={} && second_data:!={} && some_field:=[A,B]"
}

Expected Behavior

I expect to only see results that either first_data or second_data have a value

Actual Behavior

I see results have both first_data and second_data equal to {}
sample

Metadata

Typesense Version: 0.15.0

OS: Ubuntu 22.04.2 LTS

Ngôn ngữ chính
Python
Star
247
Fork
66
Merge trung bình
22 giờ 47 phút
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của typesense/typesense-python

Tất cả issue của typesense/typesense-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.