Open maxhbr opened 5 years ago
ping @maierthomas: you have last touched the code, can you explain what the ~
is doing and why it is added via prepareFuzzyQuery
to the query which seemingly tries to find all users.
Fuzzy query is used to find similar results based on the search text, like fuzzy~ will return wuzzy or luzzy. You can find the complete explanation about fuzzy searches here
Yes I refactored searchByNameAndEmail
and added the method prepareFuzzyQuery
. But the behavior of the implementation is the same.
First of all I can face two problems.
searchByNameAndEmail
.
Some mail address contain special chars like '.' '-' and I think these address are spitted in different terms.searchByNameAndEmail
is executed without any search text. So the system creates a query only with the fuzzy character ""~. Of course this cannot be executed and an error occurs.UserPortlet.java (doView)
backEndUsers = CommonUtils.nullToEmptyList(client.searchUsers(null));
The line https://github.com/eclipse/sw360/blob/e52f0e1635580e24032d8f7963e3ffddfcb9bb4e/libraries/lib-datahandler/src/main/java/org/eclipse/sw360/datahandler/couchdb/lucene/LuceneAwareDatabaseConnector.java#L214 in
prepareFuzzyQuery
causes some queries to be invalid.E.g. if some one initially uploads the users list, the request
is issued (
%7E
is an url-encoded~
) and as a result the following error log is printed:This might cause unexpected behaviour in the user upload.
related commits: