@@ -519,6 +519,7 @@ export class EngagementRepository extends CommonRepository {
519
519
@OnIndex ( 'schema' )
520
520
private async createSchemaIndexes ( ) {
521
521
await this . db . query ( ) . apply ( NameIndex . create ( ) ) . run ( ) ;
522
+ await this . db . query ( ) . apply ( EngagedNameIndex . create ( ) ) . run ( ) ;
522
523
await this . db . query ( ) . apply ( LanguageNameIndex . create ( ) ) . run ( ) ;
523
524
await this . db . query ( ) . apply ( InternshipNameIndex . create ( ) ) . run ( ) ;
524
525
}
@@ -553,6 +554,22 @@ export const engagementFilters = filter.define(() => EngagementFilters, {
553
554
separateQueryForEachWord : true ,
554
555
minScore : 0.9 ,
555
556
} ) ,
557
+ engagedName : filter . fullText ( {
558
+ index : ( ) => EngagedNameIndex ,
559
+ matchToNode : ( q ) =>
560
+ q . match ( [
561
+ node ( 'node' , 'Engagement' ) ,
562
+ relation ( 'out' , '' , undefined , ACTIVE ) ,
563
+ node ( '' , 'BaseNode' ) ,
564
+ relation ( 'out' , '' , undefined , ACTIVE ) ,
565
+ node ( 'match' ) ,
566
+ ] ) ,
567
+ // Treat each word as a separate search term
568
+ // Each word could point to a different node
569
+ // i.e. "first - last"
570
+ separateQueryForEachWord : true ,
571
+ minScore : 0.9 ,
572
+ } ) ,
556
573
projectId : filter . pathExists ( ( id ) => [
557
574
node ( 'node' ) ,
558
575
relation ( 'in' , '' , 'engagement' ) ,
@@ -724,6 +741,12 @@ const NameIndex = FullTextIndex({
724
741
properties : 'value' ,
725
742
analyzer : 'standard-folding' ,
726
743
} ) ;
744
+ const EngagedNameIndex = FullTextIndex ( {
745
+ indexName : 'EngagedName' ,
746
+ labels : [ 'LanguageName' , 'LanguageDisplayName' , 'UserName' ] ,
747
+ properties : 'value' ,
748
+ analyzer : 'standard-folding' ,
749
+ } ) ;
727
750
const LanguageNameIndex = FullTextIndex ( {
728
751
indexName : 'LanguageEngagementName' ,
729
752
labels : [ 'ProjectName' , 'LanguageName' , 'LanguageDisplayName' ] ,
0 commit comments