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
[DS-4010] Removed the escaping on the query parameter for the discove… #2206
Changes from 8 commits
b3abd77
a73b980
26a5531
aa4f3bb
b192552
ea42765
df5816d
47dc948
06b4e5d
7e1ca49
9e99c91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
|
||
import java.util.List; | ||
|
||
import javax.ws.rs.BadRequestException; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.dspace.app.rest.converter.DiscoverConfigurationConverter; | ||
import org.dspace.app.rest.converter.DiscoverFacetConfigurationConverter; | ||
|
@@ -91,7 +93,7 @@ public SearchConfigurationRest getSearchConfiguration(final String dsoScope, fin | |
public SearchResultsRest getSearchObjects(final String query, final String dsoType, final String dsoScope, | ||
final String configurationName, | ||
final List<SearchFilter> searchFilters, final Pageable page) | ||
throws InvalidRequestException { | ||
throws InvalidRequestException, BadRequestException { | ||
Context context = obtainContext(); | ||
|
||
DSpaceObject scopeObject = scopeResolver.resolveScope(context, dsoScope); | ||
|
@@ -108,6 +110,7 @@ public SearchResultsRest getSearchObjects(final String query, final String dsoTy | |
|
||
} catch (SearchServiceException e) { | ||
log.error("Error while searching with Discovery", e); | ||
throw new IllegalArgumentException(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @tomdesair noted here, this Exception should not be empty, as it provides no information to the user (and "swallows" the actual error). Please update this to be: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tdonohue: @Raf-atmire just committed this modification |
||
} | ||
|
||
return discoverResultConverter | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change this to
new IllegalArgumentException("Error while searching with Discovery: " + e.getMessage());
ornew IllegalArgumentException("Error while searching with Discovery, this might be a query syntax exception");
to make clients aware that we use a specific query syntax.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also make sure that that message reaches the client (e.g. HAL Browser)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now also realize that
Warning: (un)escaped characters ahead!
has probably a valid syntax. But it would not return the item with title "Warning: (un)escaped characters ahead!".Can you maybe also add an additional test query call for the "Faithful Infidel: Exploring Conformity (2nd edition)" test item but without escaping (thus query
Faithful Infidel: Exploring Conformity (2nd edition)
)? My guess is that that query returns 0 results.