Skip to content

Commit

Permalink
handle multiple users
Browse files Browse the repository at this point in the history
  • Loading branch information
schatzopoulos committed Oct 27, 2016
1 parent 6d157c3 commit d57a495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions application/solr/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ module.exports = {
rootFilters.push('kind:' + params.entity);
}

if(params.user){
params.user = encodeURIComponent(escapeSpecialChars(params.user));
rootFilters.push('user:' + params.user);
if(params.users){
let users = params.users.split(',');
let usersFilter = '';
for(let i in users){
usersFilter += (usersFilter !== '') ? ' OR ' : '';
usersFilter += 'user:' + encodeURIComponent(escapeSpecialChars(users[i]));
}
rootFilters.push('(' + usersFilter + ')');
}

if(params.license){
Expand Down
3 changes: 1 addition & 2 deletions application/solr/searchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ module.exports = {
// '&revisions.sort=id asc' +
'&rows=50&wt=json';


// let requestUri = 'http://' + solrUri + queryString;
solrClient.query(queryString).then( (resp) => {
this.checkResponse(resp).then( (res) => {

for(let i in res){
resp.docs[res[i].item].revisions = res[i];
}
Expand Down

0 comments on commit d57a495

Please sign in to comment.