Examples of weight()


Examples of org.apache.lucene.search.Query.weight()

            // filter out documents that do not match the name test
            if (nameTest != null)
            {
               Query nameQuery = new NameQuery(nameTest, version, nsMappings);
               Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
               for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1))
               {
                  int doc = nameHits.skipTo(i);
                  if (doc == -1)
                  {
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

    iter = deletesFlushed.queries.entrySet().iterator();
    while(iter.hasNext()) {
      Entry entry = (Entry) iter.next();
      Query query = (Query) entry.getKey();
      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

    // Delete by query
    IndexSearcher searcher = new IndexSearcher(reader);
    for (Entry<Query, Integer> entry : deletesFlushed.queries.entrySet()) {
      Query query = entry.getKey();
      int limit = entry.getValue().intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

  protected final void search(final Query query, final DocumentFrequencyWritable freqs, final String[] shards,
          final HitsMapWritable result, final int max, Sort sort, long timeout) throws IOException {
    timeout = getCollectorTiemout(timeout);
    final Query rewrittenQuery = rewrite(query, shards);
    final int numDocs = freqs.getNumDocsAsInteger();
    final Weight weight = rewrittenQuery.weight(new CachedDfSource(freqs.getAll(), numDocs, new DefaultSimilarity()));
    int totalHits = 0;
    final int shardsCount = shards.length;

    // Run the search in parallel on the shards with a thread pool.
    CompletionService<SearchResult> csSearch = new ExecutorCompletionService<SearchResult>(_threadPool);
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
View Full Code Here

Examples of org.apache.lucene.search.Query.weight()

                }

                // filter out documents that do not match the name test
                if (nameTest != null) {
                    Query nameQuery = new NameQuery(nameTest, version, nsMappings);
                    Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
                    for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
                        int doc = nameHits.skipTo(i);
                        if (doc == -1) {
                            // no more name tests, clear remaining
                            hits.clear(i, hits.length());
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.