Class StatsUtil

  • public class StatsUtil
    extends Object
    Various utilities for de/serialization of term stats and collection stats.

    TODO: serialization format is very simple and does nothing to compress the data.

    • Constructor Detail

      • StatsUtil

        public StatsUtil()
    • Method Detail

      • shardUrlToShard

        public static String shardUrlToShard​(String collectionName,
                                             String shardUrls)
        Parse a list of urls separated by "|" in order to retrieve a shard name.
        collectionName - collection name
        shardUrls - list of urls
        shard name, or shardUrl if no shard info is present, or null if impossible to determine (eg. empty string)
      • termsToEncodedString

        public static String termsToEncodedString​(Collection<?> terms)
      • termsFromEncodedString

        public static Set<org.apache.lucene.index.Term> termsFromEncodedString​(String data)
      • fieldsFromString

        public static Set<String> fieldsFromString​(String data)
      • termToEncodedString

        public static String termToEncodedString​(org.apache.lucene.index.Term t)
      • termToEncodedString

        public static String termToEncodedString​(String term)
      • termFromEncodedString

        public static org.apache.lucene.index.Term termFromEncodedString​(String data)
      • termStatsToString

        public static String termStatsToString​(TermStats termStats,
                                               boolean encode)