class NpmSearchHitExtractor extends ComponentSupport {

  public List<String> extractKeywords(final SearchHit searchHit) {
    String keywords = extractNpmAttribute(searchHit, P_KEYWORDS, String.class);
    if (keywords == null) {
      return emptyList();
    }
    keywords = keywords.trim();
    if (keywords.isEmpty()) {
      return emptyList();
    }
    return asList(keywords.split("\\s"));
  }

}