Class FieldFactory


  • public final class FieldFactory
    extends java.lang.Object
    A factory for Lucene Field instances with frequently used fields.
    • Method Detail

      • canCreateTypedField

        public static boolean canCreateTypedField​(Type<?> type)
      • newPathField

        public static Field newPathField​(java.lang.String path)
      • newPropertyField

        public static Field newPropertyField​(java.lang.String name,
                                             java.lang.String value,
                                             boolean tokenized,
                                             boolean stored)
      • newSimilarityFields

        public static java.util.Collection<Field> newSimilarityFields​(java.lang.String name,
                                                                      Blob value)
                                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • newBinSimilarityFields

        public static java.util.Collection<Field> newBinSimilarityFields​(java.lang.String name,
                                                                         Blob value)
                                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • newSimilarityFields

        public static java.util.Collection<Field> newSimilarityFields​(java.lang.String name,
                                                                      java.lang.String value)
      • newBinSimilarityFields

        public static java.util.Collection<Field> newBinSimilarityFields​(java.lang.String name,
                                                                         java.lang.String value)
      • newFulltextField

        public static Field newFulltextField​(java.lang.String value)
      • newFulltextField

        public static Field newFulltextField​(java.lang.String name,
                                             java.lang.String value)
      • newFulltextField

        public static Field newFulltextField​(java.lang.String value,
                                             boolean stored)
      • newFulltextField

        public static Field newFulltextField​(java.lang.String name,
                                             java.lang.String value,
                                             boolean stored)
      • newAncestorsField

        public static Field newAncestorsField​(java.lang.String path)
      • newDepthField

        public static Field newDepthField​(java.lang.String path)
      • newSuggestField

        public static Field newSuggestField​(java.lang.String... values)
      • dateToLong

        public static java.lang.Long dateToLong​(java.lang.String date)
        Date values are saved with sec resolution
        Parameters:
        date - jcr data string
        Returns:
        date value in seconds