Esempio n. 1
0
        private void  GetPayloads(ICollection <byte[]> payloads, SpanQuery query)
        {
            Mono.Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);

            while (spans.Next() == true)
            {
                if (spans.IsPayloadAvailable())
                {
                    //ICollection<byte[]> payload = spans.GetPayload();
                    System.Collections.Generic.ICollection <byte[]> payload = spans.GetPayload();
                    //IEnumerator<byte[]> it = payload.GetEnumerator();
                    foreach (byte[] bytes in payload)
                    {
                        payloads.Add(bytes);
                    }
                }
            }
        }
Esempio n. 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));
        }
Esempio n. 3
0
		private void  GetPayloads(ICollection<byte[]> payloads, SpanQuery query)
		{
			Mono.Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
			
			while (spans.Next() == true)
			{
				if (spans.IsPayloadAvailable())
				{
					//ICollection<byte[]> payload = spans.GetPayload();
                    System.Collections.Generic.ICollection<byte[]> payload = spans.GetPayload();
					//IEnumerator<byte[]> it = payload.GetEnumerator();
                    foreach (byte[] bytes in payload)
                    {
                        payloads.Add(bytes);
                    }
				}
			}
		}