LuceneUtils

com.google.appengine.api.search.dev

Class LuceneUtils

  • java.lang.Object
    • com.google.appengine.api.search.dev.LuceneUtils


  • public final class LuceneUtils
    extends java.lang.Object
    Various utilities to interface with Lucene.
    • Field Detail

      • FIELDLESS_FIELD_NAME

        public static final java.lang.String FIELDLESS_FIELD_NAME
        The name of the field under which we store tokens for all fields, so that we can search for them without a field prefix.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LuceneUtils

        public LuceneUtils()
    • Method Detail

      • makeLuceneFieldName

        public static java.lang.String makeLuceneFieldName(DocumentPb.Field field)
      • makeLuceneFieldName

        public static java.lang.String makeLuceneFieldName(java.lang.String name,
                                                           DocumentPb.FieldValue.ContentType type)
      • makeLuceneFieldNameWithExtractedText

        public static java.lang.String makeLuceneFieldNameWithExtractedText(java.lang.String name,
                                                                            DocumentPb.FieldValue.ContentType type)
      • makeLuceneFieldNameWithExtractedText

        public static java.lang.String makeLuceneFieldNameWithExtractedText(DocumentPb.Field field)
      • extractTextFromHtml

        public static java.lang.String extractTextFromHtml(java.lang.String html)
      • stringValueToDouble

        public static double stringValueToDouble(java.lang.String value)
        Locale-aware Double parsing. Double.valueOf(String) fails if your locale uses commas as decimal separators. This takes that into account.
      • toLuceneFields

        public static java.util.List<AbstractField> toLuceneFields(DocumentPb.Field field)
      • toLuceneDocument

        public static Document toLuceneDocument(java.lang.String docId,
                                                DocumentPb.Document input)
      • dateStringToLong

        public static java.lang.Long dateStringToLong(java.lang.String value)
                                               throws java.text.ParseException