Package org.fao.geonet.kernel.search.SearchManager

Examples of org.fao.geonet.kernel.search.SearchManager.TermFrequency


                        if (!encountered.contains(value)) {
                            encountered.add(value);
                            int count = Integer.parseInt(element.getAttributeValue("count"));

                            if (value.toLowerCase().contains(searchValueWithoutWildcard.toLowerCase())) {
                                TermFrequency term = new TermFrequency(value, count);
                                suggestions.add(term);
                            }
                        }
                    }
                }
            }
    }
   
    // Filter values which does not reach the threshold
    if (threshold > 1) {
      int size = suggestions.size();
      Iterator<TermFrequency> it = suggestions.iterator();
      while (it.hasNext()) {
                TermFrequency term = it.next();
        if (term.getFrequency() < threshold) {
          it.remove();
        }
      }
      if (Log.isDebugEnabled(Geonet.SEARCH_ENGINE)) {
        Log.debug(Geonet.SEARCH_ENGINE, "  " + suggestions.size() + "/" + size + " above threshold: " + threshold);
View Full Code Here

TOP

Related Classes of org.fao.geonet.kernel.search.SearchManager.TermFrequency

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.