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

"_searchmode=raw" throws an index out of range error when combined with "_search_COLUMN" #1134

Closed
clausjuhl opened this issue Dec 9, 2020 · 4 comments
Labels

Comments

@clausjuhl
Copy link

Hi Simon!
Maybe it's just me, but when using _searchmode=raw (trying to enable wildcard-searching) in combination with the "_search_COLUMN"-table argument, I get a list index out of range error. When combining with the simpler "_search"-argument everything works, including wildcard-seaches.. Here's the traceback:

Traceback (most recent call last):
  File "/Users/cjk/.local/share/virtualenvs/minutes-jMDZ8Ssk/lib/python3.7/site-packages/datasette/utils/asgi.py", line 122, in route_path
    return await view(new_scope, receive, send)
  File "/Users/cjk/.local/share/virtualenvs/minutes-jMDZ8Ssk/lib/python3.7/site-packages/datasette/utils/asgi.py", line 196, in view
    request, **scope["url_route"]["kwargs"]
  File "/Users/cjk/.local/share/virtualenvs/minutes-jMDZ8Ssk/lib/python3.7/site-packages/datasette/views/base.py", line 204, in get
    request, database, hash, correct_hash_provided, **kwargs
  File "/Users/cjk/.local/share/virtualenvs/minutes-jMDZ8Ssk/lib/python3.7/site-packages/datasette/views/base.py", line 342, in view_get
    request, database, hash, **kwargs
  File "/Users/cjk/.local/share/virtualenvs/minutes-jMDZ8Ssk/lib/python3.7/site-packages/datasette/views/table.py", line 393, in data
    search_col = key.split("_search_", 1)[1]
IndexError: list index out of range

@simonw
Copy link
Owner

simonw commented Dec 9, 2020

Thanks for the bug report!

simonw added a commit that referenced this issue Dec 9, 2020
simonw added a commit that referenced this issue Dec 9, 2020
@simonw
Copy link
Owner

simonw commented Dec 9, 2020

A fix for this should be available if you upgrade to 0.52.5

@simonw
Copy link
Owner

simonw commented Dec 9, 2020

https://byraadsarkivet.aarhus.dk/db/cases?_searchmode=raw&_search=sundhedsfrem%2A is an absolutely beautiful example of a themed Datasette! Very excited to show this to people.

@clausjuhl
Copy link
Author

Hi Simon

Thank you for the quick fix! And glad you like our use of Datasette (launches 1. january 2021). It's a site that currently (more to come) makes all minutes and their annexes from Aarhus City Council and the major committees (1997-2019) available to the public. So we're putting Datasette to good use :)

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

No branches or pull requests

2 participants