Hey team, I am trying to introduce a new `Browsabl...
# troubleshoot
r
Hey team, I am trying to introduce a new
BrowsableEntityType
and noticed other existing type has some variable called
FACET_FIELDS
like in
DashboardType
Copy code
private static final Set<String> FACET_FIELDS = ImmutableSet.of("access", "tool");
l
@early-lamp-41924 ^
e
Hey. which part of the code are you referring to ^ ? We shouldn’t need FACET_FIELDS any more after no-code push last year!
r
oh, I am adding a new
BrowsableEntityType
I found the
FACET_FIELDS
in all other
BrowsableEntityType
like
DashboardType.java
Copy code
private static final Set<String> FACET_FIELDS = ImmutableSet.of("access", "tool");
e
This needs a bit of cleanup 😞 but
you can ignore facet fields for both browse and autocomplete
and ignore search. you can even throw notsupportedexception
r
oh, what should I do in order to support BrowsableEntityType?
e
oh no continue what you were doing
just ignore the filters input, since that is not used as of now
r
I copied the code from other Type, like
Copy code
@Override
  public BrowseResults browse(@Nonnull List<String> path, @Nullable List<FacetFilterInput> filters, int start,
      int count, @Nonnull QueryContext context) throws Exception {
    final Map<String, String> facetFilters = ResolverUtils.buildFacetFilters(filters, FACET_FIELDS);
    final String pathStr = path.size() > 0 ? BROWSE_PATH_DELIMITER + String.join(BROWSE_PATH_DELIMITER, path) : "";
    final BrowseResult result =
        _entityClient.browse(DATA_DOC_ENTITY_NAME, pathStr, facetFilters, start, count, context.getAuthentication());
    return BrowseResultMapper.map(result);
  }
e
yeah just remove the facetFilters and put a Collections.emptyMap()
r
oh, cool