I've integrated Flashlight with my Angular 2 project. Flashlight does the following:
- Automatically indexes specified Firebase paths to an ElasticSearch cluster and monitors those paths for changes, re-indexing any changes.
- Responds to query objects written to a specified Firebase path (e.g., 'search/request'), writing ElasticSearch responses to a specified Firebase path (e.g., 'search/response').
Responses are written to Firebase with the following structure:
Using Angularfire 2, this is what my search looks like:
searchThreads(term: string) {
let queryBody: Object = {
index: 'firebase',
type: 'thread',
q: term
}
this.requestKey = this.af.database.list('/search/request').push(queryBody).key
}
if I want the raw results of that search with all paths shown in the image above, I'd do something like this:
this.af.database.list(`search/response/${this.requestKey}`)
What I want is the objects found at _source. I want to iterate over the response hits and populate my view with those objects. How can I get just these objects into an observable array?
