Package org.apache.lucene.search

Examples of org.apache.lucene.search.HitCollector


      private void collectContextHits() throws IOException
      {
         if (!contextHitsCalculated)
         {
            long time = System.currentTimeMillis();
            contextScorer.score(new HitCollector()
            {
               public void collect(int doc, float score)
               {
                  contextHits.set(doc);
               }
View Full Code Here


        private void calculateParent() throws IOException {
            if (hits == null) {
                hits = new BitSet(reader.maxDoc());

                final IOException[] ex = new IOException[1];
                contextScorer.score(new HitCollector() {

                    private int[] docs = new int[1];

                    public void collect(int doc, float score) {
                        try {
View Full Code Here

        }

        private void calculateChildren() throws IOException {
            if (uuids == null) {
                uuids = new ArrayList();
                contextScorer.score(new HitCollector() {
                    public void collect(int doc, float score) {
                        hits.set(doc);
                    }
                });

                // collect nameTest hits
                final BitSet nameTestHits = new BitSet();
                if (nameTestScorer != null) {
                    nameTestScorer.score(new HitCollector() {
                        public void collect(int doc, float score) {
                            nameTestHits.set(doc);
                        }
                    });
                }
View Full Code Here

            final ChildrenCalculator[] calc = new ChildrenCalculator[1];
            if (nameTestScorer == null)
            {
               // always use simple in that case
               calc[0] = new SimpleChildrenCalculator(reader, hResolver);
               contextScorer.score(new HitCollector()
               {
                  public void collect(int doc, float score)
                  {
                     calc[0].collectContextHit(doc);
                  }
               });
            }
            else
            {
               // start simple but switch once threshold is reached
               calc[0] = new SimpleChildrenCalculator(reader, hResolver);
               contextScorer.score(new HitCollector()
               {

                  private List docIds = new ArrayList();

                  public void collect(int doc, float score)
View Full Code Here

                final ChildrenCalculator[] calc = new ChildrenCalculator[1];
                if (nameTestScorer == null) {
                    // always use simple in that case
                    calc[0] = new SimpleChildrenCalculator(reader, hResolver);
                    contextScorer.score(new HitCollector() {
                        public void collect(int doc, float score) {
                            calc[0].collectContextHit(doc);
                        }
                    });
                } else {
                    // start simple but switch once threshold is reached
                    calc[0] = new SimpleChildrenCalculator(reader, hResolver);
                    contextScorer.score(new HitCollector() {

                        private List docIds = new ArrayList();

                        public void collect(int doc, float score) {
                            calc[0].collectContextHit(doc);
View Full Code Here

        }

        private void collectContextHits() throws IOException {
            if (!contextHitsCalculated) {
                long time = System.currentTimeMillis();
                contextScorer.score(new HitCollector() {
                    public void collect(int doc, float score) {
                        contextHits.set(doc);
                    }
                }); // find all
                contextHitsCalculated = true;
View Full Code Here

        }

        private void collectContextHits() throws IOException {
            if (!contextHitsCalculated) {
                long time = System.currentTimeMillis();
                contextScorer.score(new HitCollector() {
                    public void collect(int doc, float score) {
                        contextHits.set(doc);
                    }
                }); // find all
                contextHitsCalculated = true;
View Full Code Here

      throw new IllegalArgumentException("query must not be null");
   
    Searcher searcher = createSearcher();
    try {
      final float[] scores = new float[1]; // inits to 0.0f (no match)
      searcher.search(query, new HitCollector() {
        public void collect(int doc, float score) {
          scores[0] = score;
        }
      });
      float score = scores[0];
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.HitCollector

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.