Package bak.pcj.map

Examples of bak.pcj.map.ObjectKeyIntOpenHashMap


          // parse each document in the index
          String[] fieldValues;
                    Collator stringCollator = Collator.getInstance();
                    stringCollator.setStrength(Collator.PRIMARY);
                    SortedSet<String> sortedValues = new TreeSet<String>(stringCollator);
          ObjectKeyIntOpenHashMap duplicateValues = new ObjectKeyIntOpenHashMap();
          for (int j = 0; j < hits.scoreDocs.length; j++) {
              DocumentStoredFieldVisitor selector = new DocumentStoredFieldVisitor(fields);
            reader.document(hits.scoreDocs[j].doc, selector);
            Document doc = selector.getDocument();

            // Skip templates and subTemplates
            String[] isTemplate = doc.getValues("_isTemplate");
            if (isTemplate[0] != null && !isTemplate[0].equals("n"))
              continue;
           
            // Get doc values for specified property
            fieldValues = doc.getValues(property);
            if (fieldValues == null)
              continue;
           
            addtoSortedSet(sortedValues, fieldValues, duplicateValues);
          }
         
          SummaryComparator valuesComparator = new SummaryComparator(SortOption.FREQUENCY, Type.STRING, context.getLanguage(), null);
          TreeSet<SummaryComparator.SummaryElement> sortedValuesFrequency = new TreeSet<SummaryComparator.SummaryElement>(valuesComparator);
                    ObjectKeyIntMapIterator entries = duplicateValues.entries();
                   
                    while(entries.hasNext()) {
                        entries.next();
                        sortedValuesFrequency.add(new SummaryComparator.SummaryElement(entries));
                    }
View Full Code Here

TOP

Related Classes of bak.pcj.map.ObjectKeyIntOpenHashMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.