code: private List<Serializable> transformValue(@NotNull Object value) {
          List<Serializable> values = new ArrayList<>();
  
          if (value instanceof String) {
              List<String> build = extractWords((String) value, Language.RU);
  
              values.addAll(build);
  
          } else if (value instanceof Collection) {
              Collection<Serializable> collection = (Collection) value;
              List<Serializable> collect = collection.stream()
                                                     .flatMap(item -> transformValue(item).stream())
                                                     .collect(Collectors.<Serializable>toList());
  
              values.addAll(collect);
          } else {
              values.add((Serializable) value);
          }
  
          return values;
      }
docs: Try to transform field value to primitive type
  
  @param value Facet value
  
  @return Value transformed to base types