Specific Department Names - Sharepoint Search

I need to get different values ​​of departments where the area is people. I tried with a full text Sharepoint query, but that doesn't seem to return the individual values. So the only thing I can do is get different values ​​from the data. But this approach slows down the application when there are a huge number of people belonging to a particular department, since the name of the department is repeated as many times as the number of people belonging to that department.

What could be the alternative?

Thank,

+2


source to share


1 answer


FullTextSqlQuery does not support DISTINCT operations. However, you can use LINQ on the resulting DataTable:



IEnumerable<DataRow> distinctValues = 
    DataTable.Load(resulttable).AsEnumerable().Distinct(DataRowComparer.Default);

      

+2


source







All Articles