Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #261 from marklise/master
Browse files Browse the repository at this point in the history
MEM-510: Search Improvements.
  • Loading branch information
marklise authored Sep 22, 2017
2 parents 31908b2 + 61c4c70 commit de0a60f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/core/server/controllers/core.dbmodel.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ _.extend (DBModel.prototype, {
q = _.extend (q, {"documentDate" : { $lte : new Date(dateRangeEnd) }});
}
if (project) {
q = _.extend (q, {"project" : project});
var projects = project.split(',');
if (projects.length > 0) {
q = _.extend(q, { "project": {$in : projects}});
}
}
console.log("q:", q);

Expand Down
4 changes: 3 additions & 1 deletion modules/search/server/routes/search.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module.exports = function (app) {
var projectQuery = {};
// TODO: Make sure this is a valid objectID, wrap with try/catches.
if (req.query.project) {
projectQuery = { _id: req.query.project };
projects = req.query.project.split(',');
projectQuery = _.extend (projectQuery, { "_id": {$in : projects}});
console.log("project query:", projectQuery);
}
// TBD
// if (req.query.oweneroperator) {
Expand Down

0 comments on commit de0a60f

Please sign in to comment.