|
3 | 3 | * or more contributor license agreements. Licensed under the Elastic License;
|
4 | 4 | * you may not use this file except in compliance with the Elastic License.
|
5 | 5 | */
|
6 |
| -package org.elasticsearch.xpack.ml.datafeed.extractor.fields; |
| 6 | +package org.elasticsearch.xpack.ml.extractor; |
7 | 7 |
|
8 | 8 | import org.elasticsearch.action.fieldcaps.FieldCapabilities;
|
9 | 9 | import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse;
|
@@ -57,17 +57,17 @@ public static ExtractedFields build(Collection<String> allFields, Set<String> sc
|
57 | 57 | return new ExtractedFields(allFields.stream().map(field -> extractionMethodDetector.detect(field)).collect(Collectors.toList()));
|
58 | 58 | }
|
59 | 59 |
|
60 |
| - protected static class ExtractionMethodDetector { |
| 60 | + public static class ExtractionMethodDetector { |
61 | 61 |
|
62 | 62 | private final Set<String> scriptFields;
|
63 | 63 | private final FieldCapabilitiesResponse fieldsCapabilities;
|
64 | 64 |
|
65 |
| - protected ExtractionMethodDetector(Set<String> scriptFields, FieldCapabilitiesResponse fieldsCapabilities) { |
| 65 | + public ExtractionMethodDetector(Set<String> scriptFields, FieldCapabilitiesResponse fieldsCapabilities) { |
66 | 66 | this.scriptFields = scriptFields;
|
67 | 67 | this.fieldsCapabilities = fieldsCapabilities;
|
68 | 68 | }
|
69 | 69 |
|
70 |
| - protected ExtractedField detect(String field) { |
| 70 | + public ExtractedField detect(String field) { |
71 | 71 | String internalField = field;
|
72 | 72 | ExtractedField.ExtractionMethod method = ExtractedField.ExtractionMethod.SOURCE;
|
73 | 73 | Set<String> types = getTypes(field);
|
@@ -107,7 +107,7 @@ private Set<String> getTypes(String field) {
|
107 | 107 | return fieldCaps == null ? Collections.emptySet() : fieldCaps.keySet();
|
108 | 108 | }
|
109 | 109 |
|
110 |
| - protected boolean isAggregatable(String field) { |
| 110 | + public boolean isAggregatable(String field) { |
111 | 111 | Map<String, FieldCapabilities> fieldCaps = fieldsCapabilities.getField(field);
|
112 | 112 | if (fieldCaps == null || fieldCaps.isEmpty()) {
|
113 | 113 | throw new IllegalArgumentException("cannot retrieve field [" + field + "] because it has no mappings");
|
|
0 commit comments