forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatasetSearchConfig.java
42 lines (35 loc) · 1.07 KB
/
DatasetSearchConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.linkedin.metadata.configs;
import com.linkedin.metadata.dao.search.BaseSearchConfig;
import com.linkedin.metadata.dao.utils.SearchUtils;
import com.linkedin.metadata.search.DatasetDocument;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
public class DatasetSearchConfig extends BaseSearchConfig<DatasetDocument> {
@Override
@Nonnull
public Set<String> getFacetFields() {
return Collections.unmodifiableSet(new HashSet<>(Arrays.asList("origin", "platform")));
}
@Nonnull
public Class getSearchDocument() {
return DatasetDocument.class;
}
@Override
@Nonnull
public String getDefaultAutocompleteField() {
return "name";
}
@Override
@Nonnull
public String getSearchQueryTemplate() {
return SearchUtils.readResourceFile(getClass(), "datasetESSearchQueryTemplate.json");
}
@Override
@Nonnull
public String getAutocompleteQueryTemplate() {
return SearchUtils.readResourceFile(getClass(), "datasetESAutocompleteQueryTemplate.json");
}
}