Ejemplo n.º 1
0
			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;
			}
Ejemplo n.º 2
0
			private void  InitBlock(MatchAllDocsQuery enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Ejemplo n.º 3
0
			public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher)
			{
				InitBlock(enclosingInstance);
				this.similarity = searcher.Similarity;
			}
Ejemplo n.º 4
0
        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));
            }
        }