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)); } }
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)); } }
public ConceptHintSearcher(IConceptHintSearchService searchService) { searcher = searchService; }
public ConceptHintSearcher(IConceptHintSearchService searchService, ILogger <ConceptHintSearcher> log) { searcher = searchService; this.log = log; }