Package org.apache.lucene.util

Examples of org.apache.lucene.util.PriorityQueue.pop()


      // retrieve fragment infos from queue and fill into list, least
      // fragment comes out first
      List infos = new LinkedList();
      while (bestFragments.size() > 0)
      {
         FragmentInfo fi = (FragmentInfo)bestFragments.pop();
         infos.add(0, fi);
      }

      Map offsetInfos = new IdentityHashMap();
      // remove overlapping fragment infos
View Full Code Here


        ArrayList al = new ArrayList(maxQueryTerms);
        PriorityQueue pq = retrieveTerms(docNum);
        Object cur;
        int lim = maxQueryTerms; // have to be careful, retrieveTerms returns all words but that's probably not useful to our caller...
        // we just want to return the top words
        while (((cur = pq.pop()) != null) && lim-- > 0) {
            Object[] ar = (Object[]) cur;
            al.add(ar[0]); // the 1st entry is the interesting word
        }
        String[] res = new String[al.size()];
        return (String[]) al.toArray(res);
View Full Code Here

        ArrayList al = new ArrayList(maxQueryTerms);
        PriorityQueue pq = retrieveTerms(r);
        Object cur;
        int lim = maxQueryTerms; // have to be careful, retrieveTerms returns all words but that's probably not useful to our caller...
        // we just want to return the top words
        while (((cur = pq.pop()) != null) && lim-- > 0) {
            Object[] ar = (Object[]) cur;
            al.add(ar[0]); // the 1st entry is the interesting word
        }
        String[] res = new String[al.size()];
        return (String[]) al.toArray(res);
View Full Code Here

      // retrieve fragment infos from queue and fill into list, least
      // fragment comes out first
      List infos = new LinkedList();
      while (bestFragments.size() > 0)
      {
         FragmentInfo fi = (FragmentInfo)bestFragments.pop();
         infos.add(0, fi);
      }

      Map offsetInfos = new IdentityHashMap();
      // remove overlapping fragment infos
View Full Code Here

        }
        // at this point, queue contains top maxCnt facets that have hitcount >= minHits
        while(qsize-- > 0)
        {
          // append each entry to the beginning of the facet list to order facets by hits descending
          list.addFirst((BrowseFacet) queue.pop());
        }
      }
      else
      {
        // no maxCnt specified. So fetch all facets according to minHits and sort them later
View Full Code Here

            browseFacet = (BrowseFacet)queue.insertWithOverflow(browseFacet);
          }
        }
        // remove from queue and add to the list
        while(qsize-- > 0)
          list.addFirst((BrowseFacet)queue.pop());
      }
      else
      {
        // order by custom but no max count supplied
        while((facet = iter.next(minHits)) != null)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.