Search in sources :

Example 1 with EntitySearchService

use of org.finos.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.APPLICATION,
    EntityKind.LOGICAL_DATA_ELEMENT)).searchQuery("desk").userId("admin").build();
    String[] searchTerms = { "cat", "admin", "test", "enhance", "ceo", "equities" };
    searchService.search(searchOptions).forEach(d -> System.out.println(d.name()));
    System.exit(-1);
    Arrays.stream(searchTerms).forEach(term -> {
        System.out.println("-------------------");
        System.out.printf("Searching for '%s'\n", term);
        System.out.println("-------------------");
        printResults(searchService.search(searchOptions));
    });
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ImmutableEntitySearchOptions(org.finos.waltz.model.entity_search.ImmutableEntitySearchOptions) EntitySearchOptions(org.finos.waltz.model.entity_search.EntitySearchOptions) EntitySearchService(org.finos.waltz.service.entity_search.EntitySearchService)

Aggregations

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