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" in table metadata #1389

Closed
simonw opened this issue Jul 8, 2021 · 6 comments
Closed

"searchmode": "raw" in table metadata #1389

simonw opened this issue Jul 8, 2021 · 6 comments

Comments

@simonw
Copy link
Owner

simonw commented Jul 8, 2021

http://localhost:8001/index/summary?_search=language%3Aeng&_sort=title&_searchmode=raw

But I'm not able to manage it in the metadata file. Here is mine (note that the sort column is taken into account)
Here it is:

{
    "databases": {
      "index": {
        "tables": {
            "summary": {
                "sort": "title",
                "searchmode": "raw"
            }
        }
      }
    }
  }

Originally posted by @Krazybug in #759 (comment)

@simonw simonw added the metadata label Jul 8, 2021
@simonw
Copy link
Owner Author

simonw commented Jul 8, 2021

This makes sense to me since other useful querystring arguments like this can be set as defaults in the metadata.json configuration.

@simonw
Copy link
Owner Author

simonw commented Jul 8, 2021

@simonw
Copy link
Owner Author

simonw commented Jul 8, 2021

Relevant code:

fts_pk = special_args.get("_fts_pk", table_metadata.get("fts_pk", "rowid"))
search_args = dict(
pair
for pair in special_args.items()
if pair[0].startswith("_search") and pair[0] != "_searchmode"
)
search = ""
search_mode_raw = special_args.get("_searchmode") == "raw"

@simonw
Copy link
Owner Author

simonw commented Jul 8, 2021

If I implement this I'll also set it up so ?_searchmode=default can be used to over-ride that and go back to the default behaviour.

@simonw
Copy link
Owner Author

simonw commented Jul 8, 2021

Also came up here: #268 (comment)

@simonw
Copy link
Owner Author

simonw commented Jul 10, 2021

I don't like ?_searchmode=default because it suggests "use the default" - but it actually over-rides the default that was specified by "searchmode": "raw" in metadata.json.

I'm going with ?_searchmode=escaped instead.

@simonw simonw changed the title Feature idea: "searchmode": "raw" in table metadata "searchmode": "raw" in table metadata Jul 10, 2021
@simonw simonw closed this as completed in 83f6799 Jul 10, 2021
simonw added a commit that referenced this issue Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant