Skip to content

Commit 8717eca

Browse files
committed
Adding repos to indexing
1 parent 7662e2d commit 8717eca

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Diff for: bin/events.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ function poll() {
1212
type: 'repository',
1313
body: {
1414
size: 1000,
15-
fields: ['issue_events_url']
15+
fields: [
16+
'id',
17+
'full_name',
18+
'name',
19+
'issue_events_url'
20+
]
1621
}
1722
};
1823
return client.search(options)
@@ -26,6 +31,11 @@ function poll() {
2631
console.log('Setting refreshInterval to ', refreshInterval);
2732
}
2833
return Promise.each(data.body, function (event) {
34+
event.repo = {
35+
id: doc.fields.id[0],
36+
name: doc.fields.name[0],
37+
full_name: doc.fields.full_name[0]
38+
};
2939
var options = {
3040
index: 'octojefe',
3141
type: 'event',
@@ -43,12 +53,18 @@ function poll() {
4353
.then(function (event) {
4454
if (event) {
4555
console.log('Updating event:' + event.id);
56+
var body = event.issue;
57+
body.repo = {
58+
id: doc.fields.id[0],
59+
name: doc.fields.name[0],
60+
full_name: doc.fields.full_name[0]
61+
};
4662
var options = {
4763
index: 'octojefe',
4864
type: 'issue',
49-
body: event.issue,
50-
id: 'issue:' + event.issue.id
51-
}
65+
body: body,
66+
id: 'issue:' + body.id
67+
};
5268
return client.index(options)
5369
}
5470
})

0 commit comments

Comments
 (0)