Created
December 24, 2015 03:13
-
-
Save anonymous/69802ee3d24ff19f3ee0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.post('/search', function(req, res, next) { | |
| //Im confused right now. | |
| }); | |
| router.get('/search?q=search_term', function(req, res, next) { | |
| Product.search( | |
| { | |
| query_string: | |
| { query: req.query.q } | |
| } , function(err, results) { | |
| if (err) return next(err); | |
| var data = results.hits.hits.map(function(hit) { | |
| return hit; | |
| }); | |
| return res.render('main/search-results', { data: data }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment