Record Class FieldName
java.lang.Object
java.lang.Record
org.alfresco.repo.search.impl.elasticsearch.model.FieldName
- Record Components:
raw- The raw property name - e.g. cm:content, PATH
The various names of a property stored in different ways in Elasticsearch.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aFieldNamerecord class.FieldName(PropertyDefinition propertyDefinition) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConvert an encoded property name to the raw name.encoded()Generate the encoded format of the property name.static StringConvert a raw property name to an encoded format.final booleanIndicates whether some other object is "equal to" this one.Generate the ES exact term search format of the property name.static StringexactTermSearch(String name) Convert a raw property name to the ES exact term search property name.static FieldNamefromExactTermSearch(String name) Create a new FieldName from the exact term version.static FieldNamefromLucene(String name, NamespaceDAO namespaceDAO) Create a FieldName from a Lucene property name.static FieldNamefromUntokenized(String name) Create a new FieldName from the untokenized version.final inthashCode()Returns a hash code value for this object.static booleanisExactTermSearch(String nameWithUnknownFormat) Check if a property is an ES exact term field.static booleanisUntokenized(String nameWithUnknownFormat) Check if a property is an ES untokenized field.raw()Returns the value of therawrecord component.final StringtoString()Returns a string representation of this record class.Generate the truncated format of the field name.static StringCreate the truncated format of the field name.Generate the ES untokenized version of the property name.static Stringuntokenized(String name) Convert a raw property name to the ES untokenized property name.
-
Constructor Details
-
FieldName
-
FieldName
Creates an instance of aFieldNamerecord class.- Parameters:
raw- the value for therawrecord component
-
-
Method Details
-
fromExactTermSearch
Create a new FieldName from the exact term version.- Parameters:
name- The exact term search field - e.g. cm%3Acontent_exact- Returns:
- The new FieldName.
-
fromUntokenized
Create a new FieldName from the untokenized version.- Parameters:
name- The untokenized version of the property - e.g. cm%3Aname_untokenized, ASPECT_untokenized- Returns:
- The new FieldName.
-
fromLucene
Create a FieldName from a Lucene property name.- Parameters:
name- The lucene property name - for example @cm:name, @{http://www.alfresco.org/model/content/1.0}titlenamespaceDAO- The namespace DAO used to find the prefix for the property.- Returns:
- The new FieldName.
-
encoded
Generate the encoded format of the property name.- Returns:
- The encoded property name - e.g. cm%3Acontent, PATH
-
untokenized
Generate the ES untokenized version of the property name.- Returns:
- The untokenized property name - e.g. cm%3Acontent_untokenized, ASPECT_untokenized
-
exactTermSearch
Generate the ES exact term search format of the property name.- Returns:
- The exact term search field - e.g. cm%3Acontent_exact
-
truncated
Generate the truncated format of the field name.- Returns:
- The truncated name - e.g. cm:content, ...ty_with_insanely_long_name_for_testing_purposes
-
isUntokenized
Check if a property is an ES untokenized field.- Parameters:
nameWithUnknownFormat- The property name to check.- Returns:
- true if the name ends with the untokenized suffix.
-
isExactTermSearch
Check if a property is an ES exact term field.- Parameters:
nameWithUnknownFormat- The property name to check.- Returns:
- true if the name ends with the exact term suffix.
-
encoded
Convert a raw property name to an encoded format.- Parameters:
name- The raw property name - e.g. cm:content, PATH- Returns:
- The encoded property name - e.g. cm%3Acontent, PATH
-
untokenized
Convert a raw property name to the ES untokenized property name.- Parameters:
name- The raw property name - e.g. cm:content, ASPECT- Returns:
- The untokenized property name - e.g. cm%3Acontent_untokenized, ASPECT_untokenized
-
exactTermSearch
Convert a raw property name to the ES exact term search property name.- Parameters:
name- The raw property name - e.g. cm:content- Returns:
- The exact term search field - e.g. cm%3Acontent_exact
-
truncated
Create the truncated format of the field name.- Parameters:
name- A property name - e.g. cm:content, cm:property_with_insanely_long_name_for_testing_purposes- Returns:
- The truncated name - e.g. cm:content, ...ty_with_insanely_long_name_for_testing_purposes
-
decode
Convert an encoded property name to the raw name.- Parameters:
name- The encoded property name - e.g. cm%3Aname, PATH- Returns:
- The raw name - e.g. cm:name, PATH
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
raw
Returns the value of therawrecord component.- Returns:
- the value of the
rawrecord component
-