/** * creates a weight for <code>query</code> * @return new weight */ protected Weight createWeight(Query query) throws IOException { return query.weight(this); }
/** * creates a weight for <code>query</code> * @return new weight */ protected Weight createWeight(Query query) throws IOException { return query.weight(this); }
Hits(Searcher s, Query q, Filter f) throws IOException { this.weight = q.weight(s); this.searcher = s; this.filter = f; this.nDeletions = countDeletions(s); getMoreDocs(50); this.lengthAtStart = this.length; }
@Override public void createWeight(Map context, Searcher searcher) throws IOException { Weight w = q.weight(searcher); context.put(this, w); } }
public QueryDocValues(IndexReader reader, Query q, float defVal, Weight w) throws IOException { this.reader = reader; this.q = q; this.defVal = defVal; weight = w!=null ? w : q.weight(new IndexSearcher(reader)); }
public CustomWeight(Searcher searcher) throws IOException { this.similarity = getSimilarity(searcher); this.subQueryWeight = subQuery.weight(searcher); this.subQueryWeight = subQuery.weight(searcher); this.valSrcWeights = new Weight[valSrcQueries.length]; for(int i = 0; i < valSrcQueries.length; i++) { this.valSrcWeights[i] = valSrcQueries[i].createWeight(searcher); } this.qStrict = strict; }
public CustomWeight(Searcher searcher) throws IOException { this.similarity = getSimilarity(searcher); this.subQueryWeight = subQuery.weight(searcher); this.subQueryWeight = subQuery.weight(searcher); this.valSrcWeights = new Weight[valSrcQueries.length]; for(int i = 0; i < valSrcQueries.length; i++) { this.valSrcWeights[i] = valSrcQueries[i].createWeight(searcher); } this.qStrict = strict; }
public Explanation explain(Query query, int doc) throws IOException { return query.weight(this).explain(reader, doc); }
Hits(Searcher s, Query q, Filter f, Sort o) throws IOException { weight = q.weight(s); searcher = s; filter = f; sort = o; nDeletions = countDeletions(s); getMoreDocs(50); // retrieve 100 initially lengthAtStart = length; }
Hits(Searcher s, Query q, Filter f) throws IOException { weight = q.weight(s); searcher = s; filter = f; nDeletions = countDeletions(s); getMoreDocs(50); // retrieve 100 initially lengthAtStart = length; }
/** * @inheritDoc */ @Override public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { contextScorer = context.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer); return new NotQueryScorer(reader); }
Hits(Searcher s, Query q, Filter f, Sort o) throws IOException { weight = q.weight(s); searcher = s; filter = f; sort = o; nDeletions = countDeletions(s); getMoreDocs(50); // retrieve 100 initially lengthAtStart = length; }
Hits(Searcher s, Query q, Filter f) throws IOException { weight = q.weight(s); searcher = s; filter = f; nDeletions = countDeletions(s); getMoreDocs(50); // retrieve 100 initially lengthAtStart = length; }
public BoostedWeight(Searcher searcher) throws IOException { this.searcher = searcher; this.qWeight = q.weight(searcher); this.context = boostVal.newContext(); boostVal.createWeight(context,searcher); }
public HippoLuceneQueryHits(IndexReader reader, Filter filter, IndexSearcher searcher, Query query) throws IOException { this.reader = reader; if (filter == null) { this.filter = null; } else { this.filter = filter.getDocIdSet(reader).iterator(); } // We rely on Scorer#nextDoc() and Scorer#advance(int) so enable // scoreDocsInOrder this.scorer = query.weight(searcher).scorer(reader, true, false); }
/** * Creates a scorer for this <code>ParentAxisQuery</code>. * * @param reader a reader for accessing the index. * @return a <code>ParentAxisScorer</code>. * @throws IOException if an error occurs while reading from the index. */ public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { contextScorer = contextQuery.weight(searcher).scorer(reader, scoreDocsInOrder, false); HierarchyResolver resolver = (HierarchyResolver) reader; return new ParentAxisScorer(searcher.getSimilarity(), reader, searcher, resolver); }
/** * Creates a scorer for this <code>ParentAxisQuery</code>. * * @param reader a reader for accessing the index. * @return a <code>ParentAxisScorer</code>. * @throws IOException if an error occurs while reading from the index. */ @Override public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { contextScorer = contextQuery.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer); HierarchyResolver resolver = (HierarchyResolver)reader; return new ParentAxisScorer(searcher.getSimilarity(), reader, searcher, resolver); }
/** * @inheritDoc */ public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { contextScorer = context.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer); if (contextScorer == null) { // context query does not match any node // the inverse is to match all nodes return new MatchAllDocsQuery().createWeight(searcher).scorer( reader, scoreDocsInOrder, false); } return new NotQueryScorer(reader); }
/** * @inheritDoc */ public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { contextScorer = context.weight(searcher).scorer(reader, scoreDocsInOrder, topScorer); if (contextScorer == null) { // context query does not match any node // the inverse is to match all nodes return new MatchAllDocsQuery().createWeight(searcher).scorer( reader, scoreDocsInOrder, false); } return new NotQueryScorer(reader); }
/** * Creates a scorer for this <code>DerefQuery</code>. * * @param reader a reader for accessing the index. * @return a <code>DerefScorer</code>. * @throws IOException if an error occurs while reading from the index. */ public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { subQueryScorer = subQuery.weight(searcher).scorer(reader, scoreDocsInOrder, false); if (nameTest != null) { nameTestScorer = new NameQuery(nameTest, version, nsMappings).weight(searcher).scorer(reader, scoreDocsInOrder, false); } return new DerefScorer(searcher.getSimilarity(), reader); }