Class SolrFieldHelper

java.lang.Object
org.ametys.cms.content.indexing.solr.SolrFieldHelper

public final class SolrFieldHelper extends Object
Helper for getting Solr field names.
  • Method Details

    • getStringIndexingFieldName

      public static String getStringIndexingFieldName(String fieldPath, String language, boolean fullText)
      Get the Solr field name (without analyzing)
      Parameters:
      fieldPath - The path to metadata
      language - The query language.
      fullText - true for a full-text query, false otherwise.
      Returns:
      the Solr field name
    • getIndexingFieldName

      public static String getIndexingFieldName(MetadataType type, String fieldPath)
      Get the Solr field name (without analyzing)
      Parameters:
      type - The type
      fieldPath - The path to metadata
      Returns:
      the Solr field name
    • getIndexingFieldName

      public static String getIndexingFieldName(MetadataType type, String fieldPath, String language)
      Get the Solr field's name (without analyzing)
      Parameters:
      type - The type
      fieldPath - The path to metadata
      language - The query language.
      Returns:
      the Solr field's name
    • getIndexingFieldName

      public static String getIndexingFieldName(MetadataType type, String fieldPath, String language, boolean fullText)
      Get the Solr field name
      Parameters:
      type - The type
      fieldPath - The path to metadata
      language - The query language.
      fullText - true if field should be analyzed.
      Returns:
      the Solr field name
    • getStringFieldSuffix

      public static String getStringFieldSuffix(String language, boolean fullText)
      Get a field suffix from its type.
      Parameters:
      language - The query language.
      fullText - true for a full-text query, false otherwise.
      Returns:
      the field name suffix.
    • getWildcardFieldSuffix

      public static String getWildcardFieldSuffix()
      Get the wildcard field suffix
      Returns:
      the field name suffix.
    • getFulltextFieldSuffix

      public static String getFulltextFieldSuffix(String language)
      Get the wildcard field suffix
      Parameters:
      language - The query language.
      Returns:
      the field name suffix.
    • getFieldSuffix

      public static String getFieldSuffix(MetadataType type)
      Get a field suffix from its type.
      Parameters:
      type - the field type.
      Returns:
      the field name suffix.
    • getFieldSuffix

      public static String getFieldSuffix(MetadataType type, String language, boolean fullText)
      Get a field suffix from its type.
      Parameters:
      type - the field type.
      language - The search language.
      fullText - true if the field is indexed full-text, false otherwise.
      Returns:
      the field name suffix.
    • getMetadataSortFieldName

      public static String getMetadataSortFieldName(MetadataType type, String metadataPath)
      Get the Solr field name for sorting
      Parameters:
      type - The type
      metadataPath - The path to metadata
      Returns:
      the Solr field name
    • getSortFieldSuffix

      public static String getSortFieldSuffix(MetadataType metaType)
      Get the suffix for sorting
      Parameters:
      metaType - The type
      Returns:
      The sort field suffix.
    • getJoinFieldName

      public static String getJoinFieldName(String metadataPath)
      Get the field name for join
      Parameters:
      metadataPath - The metadata path, separated by '/'
      Returns:
      the join field name
    • getSortValue

      public static String getSortValue(String string)
      Get the sort value for a string.
      Parameters:
      string - the string to index in a sort field.
      Returns:
      the sort value.