Search in sources :

Example 1 with EntitySearchService

use of com.khartec.waltz.service.entity_search.EntitySearchService in project waltz by khartec.

the class EntitySearchHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    EntitySearchService searchService = ctx.getBean(EntitySearchService.class);
    EntitySearchOptions searchOptions = ImmutableEntitySearchOptions.builder().entityKinds(ListUtilities.newArrayList(EntityKind.ACTOR, EntityKind.APPLICATION, EntityKind.APP_GROUP, EntityKind.CHANGE_INITIATIVE, EntityKind.ORG_UNIT, EntityKind.MEASURABLE, EntityKind.PERSON)).userId("admin").build();
    String[] searchTerms = { "cat", "admin", "test", "enhance", "ceo", "equities" };
    Arrays.stream(searchTerms).forEach(term -> {
        System.out.println("-------------------");
        System.out.printf("Searching for '%s'\n", term);
        System.out.println("-------------------");
        printResults(searchService.search(term, searchOptions));
    });
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ImmutableEntitySearchOptions(com.khartec.waltz.model.entity_search.ImmutableEntitySearchOptions) EntitySearchOptions(com.khartec.waltz.model.entity_search.EntitySearchOptions) EntitySearchService(com.khartec.waltz.service.entity_search.EntitySearchService)

Aggregations

EntitySearchOptions (com.khartec.waltz.model.entity_search.EntitySearchOptions)1 ImmutableEntitySearchOptions (com.khartec.waltz.model.entity_search.ImmutableEntitySearchOptions)1 EntitySearchService (com.khartec.waltz.service.entity_search.EntitySearchService)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1