Last active
May 29, 2018 15:10
-
-
Save mchelen/82096b9711c9689b573a312d45090233 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
| import { Get, Controller } from '@nestjs/common'; | |
| import elasticsearch = require('elasticsearch'); | |
| @Controller('search') | |
| export class SearchController { | |
| @Get() | |
| async doSearch(): Promise<any> { | |
| const.client = new elasticsearch.Client(); | |
| client.search({ | |
| q: 'pants' | |
| }).then(function (body) { | |
| var hits = body.hits.hits; | |
| return; //???? | |
| }, function (error) { | |
| console.trace(error.message); | |
| }); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment