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
Make search forms more flexible - structured queries for mod_search #3563
Comments
Example search question:
Might be mapped to: #{
<<"text">> => <<"search text">>,
<<"category">> => [
<<"text">>,
<<"document">>
],
<<"hasobject">> => #{ % Use hasanyobject for an OR
<<"subject">> => [
1234,
5678
]
},
<<"language">> => [
<<"en">>,
<<"nl">>
],
<<"date_start_after">> => <<"some date">>,
<<"date_end_before">> => <<"some other date">>
} With query args:
|
cat: Artists Input text Magazine |
Freely thinking about what would look clear to me as a query url (clarity being a concern), it might be something like (substituting the "subject" predicate with "hasauthor" for disambiguation):
where
I know this deviates from the way how forms are encoded, which leads me to consider this as a pseudocode for what we really need: to merge form serialisation with configuring queries. This way the query stays self-documenting, but also is (de)serialisable in a straightforward manner.
The syntax of Another concern (apart from readability and self-documenting/completeness) is that we can't query nested links (as is also not covered in the first proposal), if I'm correct - to be continued.. |
Description
Currently we use simple query questions for the search forms.
They are mapped with
qargs
to a list of query terms with values.These are all used as an 'AND' query.
If a form is programmed then we need to check for every input element if the element should be checked, filled in etc.
This is quite a bit of code, and can be complex.
Make it possible to represent a search question as a (nested) map.
This could include
allof
,anyof
andnoneof
nestings.The query form can use the dotted and bracketed name notation like we use in the rsc updates.
Also add a Javascript function to match the passed query arguments with the input elements and check/uncheck/select/fill-in the corresponding input elements.
The text was updated successfully, but these errors were encountered: