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

        List<String> al = new ArrayList<String>(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((String) ar[0]); // the 1st entry is the interesting word
        }
        return al.toArray(new String[al.size()]);
    }
View Full Code Here

        List<String> al = new ArrayList<String>(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((String) ar[0]); // the 1st entry is the interesting word
        }
        return al.toArray(new String[al.size()]);
    }
View Full Code Here

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

        Map<TermVectorOffsetInfo, Object> offsetInfos = new IdentityHashMap<TermVectorOffsetInfo, Object>();
        // remove overlapping fragment infos
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

    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

        List<String> al = new ArrayList<String>(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((String) ar[0]); // the 1st entry is the interesting word
        }
        return al.toArray(new String[al.size()]);
    }
View Full Code Here

        List<String> al = new ArrayList<String>(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((String) ar[0]); // the 1st entry is the interesting word
        }
        return al.toArray(new String[al.size()]);
    }
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.