internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity, Weight w, byte[] norms):base(similarity) { InitBlock(enclosingInstance); this.termDocs = reader.TermDocs(null); score = w.Value; this.norms = norms; }
private void InitBlock(MatchAllDocsQuery enclosingInstance) { this.enclosingInstance = enclosingInstance; }
public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher) { InitBlock(enclosingInstance); this.similarity = searcher.Similarity; }
public override void LoadEndVersion(Entity entity) { using (var searcher = LuceneSearcherFactory.Create(this, entity)) { var query = new MatchAllDocsQuery(); var sortType = LuceneWriter.SortMap.ContainsKey(entity.Version.SimpleType) ? LuceneWriter.SortMap[entity.Version.SimpleType] : LuceneWriter.SortMap["*"]; var sort = new Sort(new SortField(entity.Version.Alias, sortType, true)); var hits = searcher.Search(query, null, 1, sort); entity.HasRows = hits.TotalHits > 0; if (!entity.HasRows) return; var doc = searcher.Doc(0); entity.End = Common.GetObjectConversionMap()[entity.Version.SimpleType](doc.Get(entity.Version.Alias)); } }