Example #1
0
		public override SpanFilterResult BitSpans(IndexReader reader)
		{
			
			OpenBitSet bits = new OpenBitSet(reader.MaxDoc());
			Mono.Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
			System.Collections.IList tmp = new System.Collections.ArrayList(20);
			int currentDoc = - 1;
			SpanFilterResult.PositionInfo currentInfo = null;
			while (spans.Next())
			{
				int doc = spans.Doc();
				bits.Set(doc);
				if (currentDoc != doc)
				{
					currentInfo = new SpanFilterResult.PositionInfo(doc);
					tmp.Add(currentInfo);
					currentDoc = doc;
				}
				currentInfo.AddPosition(spans.Start(), spans.End());
			}
			return new SpanFilterResult(bits, tmp);
		}
Example #2
0
        public override SpanFilterResult BitSpans(IndexReader reader)
        {
            OpenBitSet bits = new OpenBitSet(reader.MaxDoc());

            Mono.Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
            System.Collections.IList           tmp   = new System.Collections.ArrayList(20);
            int currentDoc = -1;

            SpanFilterResult.PositionInfo currentInfo = null;
            while (spans.Next())
            {
                int doc = spans.Doc();
                bits.Set(doc);
                if (currentDoc != doc)
                {
                    currentInfo = new SpanFilterResult.PositionInfo(doc);
                    tmp.Add(currentInfo);
                    currentDoc = doc;
                }
                currentInfo.AddPosition(spans.Start(), spans.End());
            }
            return(new SpanFilterResult(bits, tmp));
        }