public string GetQuery()
{
StringBuilder query = new StringBuilder("");
if (_searchTerms.Count > 0 && _fields.Count > 0)
{
for (int x = 0; x < _fields.Count; x++)
{
if (x > 0)
{
query.Append(" OR ");
}
query.Append("(");
for (int y = 0; y < _searchTerms.Count; y++)
{
if (Array.IndexOf(_noisewords, _searchTerms[y]) < 0 || !_ignoreNoiseWords)
{
if (y > 0)
{
query.Append(" AND ");
}
query.Append("[" + _fields[x] + "] LIKE '%" + _searchTerms[y] + "%'");
}
}
query.Append(")");
}
}
return query.ToString();
}