19 using System.Collections.Generic;
21 using Lucene.Net.Index;
22 using Lucene.Net.Search;
23 using Lucene.Net.Search.Spans;
24 using Lucene.Net.Util;
26 namespace Contrib.Regex
36 private readonly
Term _term;
48 public override string ToString(
string field)
50 StringBuilder sb =
new StringBuilder();
51 sb.Append(
"SpanRegexQuery(");
69 for (
int i = 0; i < clauses.Length; i++)
89 public override Lucene.Net.Search.Spans.Spans GetSpans(
IndexReader reader)
91 throw new InvalidOperationException(
"Query should have been rewritten");
95 public override string Field
103 public ICollection<Term> GetTerms()
105 ICollection<Term> terms =
new List<Term>(){_term};
111 set { _regexImpl = value; }
112 get {
return _regexImpl; }
125 if (other == null)
return false;
126 if (ReferenceEquals(
this, other))
return true;
128 if (!_regexImpl.Equals(other._regexImpl))
return false;
129 if (!_term.Equals(other._term))
return false;
139 public override bool Equals(
object obj)
150 public override int GetHashCode()
152 return 29 * _regexImpl.GetHashCode() + _term.GetHashCode();