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

Should we replace the result "id" column in document with other name ? #155

Open
pnthai88 opened this issue Oct 19, 2021 · 0 comments
Open

Comments

@pnthai88
Copy link

Hello,

While doing the loop to get every columns in search result

_query  = Query(f"{keywords}*").verbatim().paging(_start, _lenr)
_data   = _search.search(_query)
_total  = _data.total    

def c_app(itm):
            bulk = {}
            for col in dir(itm):
                if not "__" in col:
                    bulk.update({col: getattr(itm, col)})
            data.append(bulk)
 [c_app(itm) for itm in _data.docs]

Our dataset have following columns "id","owner","TTL" ... etc
We use the column name "id" as identification of data, with this id can combine to use many where on redis key, example

author::{id}
books::{id}
changes::{id}

The result of search return the "id" of the key "author::{id}" so everytime I need to get the id for books it won't return the correct id format.

i did a patch fixed at my client side, replace the default id of library (redissearch-py) to "redis_key_id"

document.py
def __init__(self, redis_key_id, payload = None, **fields):
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