mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 00:48:45 +00:00
feat(search) - add DATETIME FieldType (#4407)
* feat(search) - add DATETIME FieldType
This commit is contained in:
parent
bc1c06069a
commit
8610c29e49
@ -323,7 +323,7 @@ It takes the following parameters:
|
||||
annotations. To customize the set of analyzers used to index a certain field, you must add a new field type and define
|
||||
the set of mappings to be applied in the MappingsBuilder.
|
||||
|
||||
Thus far, we have implemented 8 fieldTypes:
|
||||
Thus far, we have implemented 9 fieldTypes:
|
||||
|
||||
1. *KEYWORD* - Short text fields that only support exact matches, often used only for filtering
|
||||
|
||||
@ -342,6 +342,8 @@ It takes the following parameters:
|
||||
7. *BOOLEAN* - Boolean fields used for filtering.
|
||||
|
||||
8. *COUNT* - Count fields used for filtering.
|
||||
|
||||
9. *DATETIME* - Datetime fields used to represent timestamps.
|
||||
|
||||
- **fieldName**: string (optional) - The name of the field in search index document. Defaults to the field name where
|
||||
the annotation resides.
|
||||
|
||||
@ -52,7 +52,8 @@ public class SearchableAnnotation {
|
||||
URN,
|
||||
URN_PARTIAL,
|
||||
BOOLEAN,
|
||||
COUNT
|
||||
COUNT,
|
||||
DATETIME
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@ -77,6 +77,8 @@ public class MappingsBuilder {
|
||||
mappingForField.put("type", "boolean");
|
||||
} else if (fieldType == FieldType.COUNT) {
|
||||
mappingForField.put("type", "long");
|
||||
} else if (fieldType == FieldType.DATETIME) {
|
||||
mappingForField.put("type", "date");
|
||||
} else {
|
||||
log.info("FieldType {} has no mappings implemented", fieldType);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user