Skip to content

Commit

Permalink
default search: only in active
Browse files Browse the repository at this point in the history
  • Loading branch information
schatzopoulos committed Nov 28, 2016
1 parent 0cc8317 commit 9ce0553
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion application/solr/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ module.exports = {
childFilters.push('tags:' + params.tags);
}

if(params.revisions === 'false'){
// if param revisions is not set, search only in active revisions
if(params.revisions === 'false' || !params.hasOwnProperty('revisions')){
childFilters.push('active:true');
}

Expand Down
4 changes: 2 additions & 2 deletions application/solr/searchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module.exports = {
'&sort=score desc, lastUpdate desc' +
'&revisions.q=' + solr_params.childQ + ' AND {!terms f=solr_parent_id v=$row.solr_id}' +
'&revisions.fq=' + solr_params.childFQ +
'&revisions.sort=score desc, id desc' +
'&revisions.sort=score desc, lastUpdate desc' +
'&rows=50&wt=json';

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

0 comments on commit 9ce0553

Please sign in to comment.