

{
await QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
using (Table table = geodatabase.OpenDataset<Table>("WaterPipeInfo"))
using (TableDefinition tableDefinition = table.GetDefinition())
{
bool supportsFullText = geodatabase.GetDatastoreProperties().SupportsFullTextIndex;
if (!supportsFullText)
{
return;
}
IReadOnlyList<Index> indexes = tableDefinition.GetIndexes();
IReadOnlyList<Field> fieldsToSearch = indexes.First().GetFields();
FullTextSearchTermExpression searchRepairStatus = new FullTextSearchTermExpression()
{
SearchFields = fieldsToSearch[0].Name,
SearchTerm = "Repaired",
SearchType = FullTextSearchType.Simple
};
FullTextSearchTermExpression searchPipeMaterial = new FullTextSearchTermExpression()
{
SearchFields = fieldsToSearch[1].Name,
SearchTerm = "Copper",
SearchType = FullTextSearchType.Simple
};
FullTextOrExpression repairedOrCopperEx = new FullTextOrExpression(searchRepairStatus, searchPipeMaterial);
QueryFilter queryfilter = new QueryFilter
{
FullTextExpression = repairedOrCopperEx,
Offset = 1,
RowCount = 20,
PostfixClause = "Order By Size"
};
using (RowCursor rowCursor = table.Search(queryfilter, false))
{
// Use row cursor ...
}
}
});
}
{
QueryFilter qf = new QueryFilter()
{
WhereClause = "Class = 'city'"
};
int count = 0;
using (RowCursor rows = selectedLayer.Search(qf)) //execute
{
//Looping through to count
while (rows.MoveNext()) count++;
}
System.Diagnostics.Debug.WriteLine(String.Format(
"Total features that matched the search criteria: {0}", count));
}
System.Object
ArcGIS.Core.Data.QueryFilter
ArcGIS.Core.Data.SpatialQueryFilter
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)