Skip to content

Commit

Permalink
Merge de18b94 into 03e683f
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed Nov 18, 2019
2 parents 03e683f + de18b94 commit e2997e9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/server/helpers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,17 @@ export async function generateIndex(orm) {
.fetchAll();

const areas = areaCollection.toJSON();

/** To index names, we use aliasSet.aliases.name and bbid, which Areas don't have.
* We massage the area to return a similar format as BB entities
*/
const processedAreas = areas.map((area) => new Object({
bbid: area.gid,
defaultAlias: {
name: area.name
aliasSet: {
aliases: [
{name: area.name}
]
},
bbid: area.gid,
type: 'Area'
}));
await _processEntityListForBulk(processedAreas);
Expand Down

0 comments on commit e2997e9

Please sign in to comment.