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
Search component does not allow you to use FacetValue with authority operator #368
Comments
By now I've had a chance to look into why these links aren't used yet, and the reason is that search is currently designed in the following way:
The main reasons for doing it this way are:
I do agree that the current way of working is not ideal; we need too much logic in the UI to figure out what needs to change to the rest call for each search control. E.g. for dates, the UI needs to work using a start and an end date, because you can change them independently, but then we need to know how to parse that start and enddate from the label, and we need to know how to put it back together to query the server. Parsing the label to get the values isn't a good idea, because you don't want to have to add custom code to the UI every time the label doesn't match the value to send to the server. So instead of having the server dictate exactly what the UI should do (hal links), or not using server input at all (the current way), perhaps we can find a way in between. If the server were to add a property that only contains how to change the current facetValue, and not everything else, the client can use those as building blocks to construct the query on its own, without having to hardcode too much details about it. If we include a simple templating system it can work for things with variable inputs as well. E.g.: In the filter below, {
"filter": "dateIssued",
"hasFacets": true,
"type": "date",
"queryParam": "f.dateIssued=[${start} TO ${end}],${operator}",
"operators": [
{
"operator": "equals"
},
{
"operator": "notequals"
},
{
"operator": "authority"
},
{
"operator": "notauthority"
},
{
"operator": "contains"
},
{
"operator": "notcontains"
}
],
"openByDefault": false
} In the facetValue below, {
"label" : "1950 - 1959",
"start": 1950,
"end": 1959,
"operator": "equals",
"count" : 27,
"type" : "discover",
"_links" : {
"search" : {
"href" : "https://rest.api/discover/search/objects?f.dateIssued=[1950 TO 1959],equals"
}
}
} |
From the above comment I recognise two tasks on the REST side:
The following JIRA ticket have been created |
@abollini, you mentioned in the meeting on 2019-03-21 that there was a way of using HAL links, where we wouldn't have to lose the advantage of having the UI components change only the URL, and responding to the URL change by querying the backend. Could you elaborate on that?
The number of results per page is also missing information. |
@atarix83 help me to understood better the issue on the angular side and unfortunately I don't think it is something that can be quickly fixed with the current implementation. You can use for sure the HAL link to refresh the page using the data coming for a fresh REST call but it will be complicated to restore the state of the application using the current URL structure. Until the url template mechanism will be introduced, if you go to change the implementation to use the single big url, the only issue will be to loss the state of the facet boxes when sharing an angular UI... honestly I think it is a minor bug, we could live with that also in a final release |
The actual implementation does not allow you to use FacetValue with authority operator, that are required to implement MyDSpace.
Here an example of FacetValue with authority operator
the correct search query to filter the result set with this facet value should use
f.namedresourcetype=workspace,authority
but because the actual implementation of the search when I click on the link of the that facet value the query is built withf.namedresourcetype=To do,query
To resolve this problem Search component should find a way to use the ‘search’ hard-link property from FacetValue to build search query
The text was updated successfully, but these errors were encountered: