Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Filtering json strings

Abierto
#32 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
search

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
247
Forks
66
Merge medio
22 h 47 min
PR fusionados (30 d)
8

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de typesense/typesense-python

Todos los issues de typesense/typesense-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.