Solving SharePoint FullTextSqlQuery Wrong Site Collection Error

The FullTextSqlQuery class is really nice for building readable query statements, all in familiar SQL syntax. While it’s a lot easier to use when querying data, the returned content is limited to that which has been indexed by SharePoint.

This is something to keep in mind, the indexing part. Consider the following code snippet, delivered as a generic static method:

[csharp]

RunQuery(“SELECT FileExtension, ContentClass, IsDocument, title, path, author from scope() “);

public static RunQuery(string queryText)
{
FullTextSqlQuery query = new FullTextSqlQuery(SPContext.Current.Site);
query.ResultTypes = ResultType.RelevantResults;
query.QueryText = queryText;
ResultTableCollection resultCollection = query.Execute();
DataTable resultDataTable = new DataTable();
ResultTable resultTable = resultCollection[ResultType.RelevantResults];
resultDataTable.Load(resultTable);
}
[/csharp]

While running such code, you may encounter a problem where the wrong site collections are returning data. It may crop up in the form of a particular site collection being always used, or a weird permutation of site collections. If this problem occurs, there are generally two causes of the problem.

1) Ensure you are referencing Microsoft.Office.Server.Search.Query.FullTextSqlQuery and not Microsoft.SharePoint.Search.Query.FullTextSqlQuery
2) Ensure in Central Administration / Site Settings / Search And Offline Availability /Indexing Site Content the content is being indexed.

Share

Exploding TFS Groups For User Investigation

When users are using Team Explorer and viewing the group membership for a particular project (Team Project Settings -> Group Membership) it’s pretty easy because explicit users and groups are listed. However, this becomes a problem when you want to view all the users of that particular group. This is very, very evident when the groups are chained, i.e. Group X contains Group Y, which contains Group z, and so forth. This becomes an issue because viewing the security information for a particular security group becomes very limited.

Fortunately, to get around this limitation you can use the TfsSecurity tool, specifically the TfsSecurity /imx command, to get the direct members of the specified group.

It is important to remember that TfsSecurity.exe comes from Team Explorer, not the Visual Studio shell.

Share

ISPCalendarSettings

Description The Microsoft.SharePoint.WebControls.ISPCalendarSettings interface to enforce exposed common properties related to Calendars. An ISPCalendarSettings object provides a typed representation of all the settings related to a Calender. The member properties exposed by this interface are: AlternateCalendarType – SPCalendarType representing the alternate to the CalendarType property, such as Hijri, Hebrew, or othersCalendarType – SPCalendarType representing the calendar typeDisplay

This Post Details Content That I Have Written Regarding The SharePoint API On MSDN. The Full Article Will Have These Contents As Annotations Of The Full Article.

I Encourage You To Read The Full MSDN Class Documentation, Since Things Like Type Hierarchy Are Illustrated.

My MSDN Community Content Located At Annotations edited by Adam Buenz – MVP:

Description The Microsoft.SharePoint.WebControls.ISPCalendarSettings interface to enforce exposed common properties related to Calendars. An ISPCalendarSettings object provides a typed representation of all the settings related to a Calender. The member properties exposed by this interface are: AlternateCalendarType SPCalendarType representing the alternate to the CalendarType property, such as Hijri, Hebrew, or othersCalendarType – SPCalendarType representing the calendar typeDisplay

Read My Complete MSDN Article: ISPCalendarSettings

Share