Exemplo n.º 1
0
        public async Task <ActionResult <ConceptEquivalentHint> > SearchEquivalent(
            string term,
            [FromServices] IConceptHintSearchService searchEngine
            )
        {
            try
            {
                var hints = await searchEngine.SearchEquivalentAsync(term);

                return(Ok(hints));
            }
            catch (Exception ex)
            {
                log.LogError("Could not search concept equivalent hint. Term:{Term} Error:{Error}", term, ex.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <ConceptHint> > > SearchHints(
            [FromQuery] Guid?rootParentId,
            [FromQuery] string term,
            [FromServices] IConceptHintSearchService searchEngine
            )
        {
            try
            {
                var terms = term.Split(' ');
                var hints = await searchEngine.SearchAsync(rootParentId, terms);

                return(Ok(hints));
            }
            catch (Exception ex)
            {
                log.LogError("Could not search concept hints. Term:{Term} Error:{Error}", term, ex.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Exemplo n.º 3
0
 public ConceptHintSearcher(IConceptHintSearchService searchService)
 {
     searcher = searchService;
 }
Exemplo n.º 4
0
 public ConceptHintSearcher(IConceptHintSearchService searchService, ILogger <ConceptHintSearcher> log)
 {
     searcher = searchService;
     this.log = log;
 }