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

URLs in search queries for filtering broken #611

Closed
joepio opened this issue Mar 6, 2023 · 1 comment
Closed

URLs in search queries for filtering broken #611

joepio opened this issue Mar 6, 2023 · 1 comment

Comments

@joepio
Copy link
Member

joepio commented Mar 6, 2023

We have a query parameter for filters, which using the tantivy QueryParser syntax. However, that doesn't seem to support escaping URL characters (or perhaps it does, but I don't know how yet).

If tantivy won't fix this upstream, we'll have to look for a different approach. We could index the shortnames (i.e. serialize to JSON instead of JSON-AD). Additionally, we'll need to either 1) let the front-end use the shortnames too, or 2) let the server fetch the shortnames and use these after parsing a filter value.

Also, we don't test for this. Bad!

joepio added a commit that referenced this issue Mar 6, 2023
@joepio
Copy link
Member Author

joepio commented Mar 9, 2023

Seems like using URL values in the key does work, but we need to escape the colons and dots in the key using slashes, and use a phrase query ("") for the value

    #[test]
    pub fn test_special_chars_escaped() {
        let q_escaped_colons = r#"https\://example.com/test/bla:"https\://examplevalue.com/test""#;
        let res = make_query_parser().parse_query(q_escaped_colons).unwrap();
        println!("{:?}", res);
    }

joepio added a commit that referenced this issue Mar 11, 2023
joepio added a commit that referenced this issue Mar 11, 2023
@joepio joepio closed this as completed Mar 11, 2023
joepio added a commit that referenced this issue Mar 13, 2023
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