19 using System.Collections.Generic;
23 using Lucene.Net.Search;
24 using Lucene.Net.Index;
25 using Lucene.Net.Util;
27 namespace Lucene.Net.Analysis
60 private Filter[] chain = null;
62 private Logic[] logicArray;
78 this.logicArray = logicArray;
93 int[] index =
new int[1];
95 if (logic !=
Logic.NONE)
96 return GetDocIdSet(reader, logic, index);
97 else if (logicArray != null)
98 return GetDocIdSet(reader, logicArray, index);
100 return GetDocIdSet(reader, DEFAULT, index);
106 if (docIdSet == null)
131 if (logic == Logic.AND)
136 else if (logic == Logic.ANDNOT)
172 for (; index[0] < chain.Length; index[0]++)
174 DoChain(result, logic, chain[index[0]].GetDocIdSet(reader));
176 return FinalResult(result, reader.
MaxDoc());
187 if (logic.Length != chain.Length)
188 throw new ArgumentException(
"Invalid number of elements in logic array");
191 for (; index[0] < chain.Length; index[0]++)
193 DoChain(result, logic[index[0]], chain[index[0]].GetDocIdSet(reader));
195 return FinalResult(result, reader.
MaxDoc());
198 public override String ToString()
200 StringBuilder sb =
new StringBuilder();
201 sb.Append(
"ChainedFilter: [");
202 for (
int i = 0; i < chain.Length; i++)
208 return sb.ToString();
220 result.
Or((OpenBitSet)dis);
223 result.
And((OpenBitSet)dis);
226 result.
AndNot((OpenBitSet)dis);
229 result.
Xor((OpenBitSet)dis);
232 DoChain(result, DEFAULT, dis);
267 DoChain(result, DEFAULT, dis);