Hi,
We are searching in WSS 3 using the class FullTextSqlQuery.
Code :
FullTextSqlQuery query = new FullTextSqlQuery(site);
string searchQuery =
@"SELECT URL FROM Scope() WHERE SITE = ' AND CONTAINS('administrator') AND isDocument = 1 ORDER BY RANK DESC";
query.QueryText = searchQuery + " ORDER BY RANK DESC";
query.RowLimit = 1000;
query.TrimDuplicates = false;
if (SPSecurity.AuthenticationMode != System.Web.Configuration.AuthenticationMode.Windows)
{
query.AuthenticationType = QueryAuthenticationType.PluggableAuthenticatedQuery;
}
else
{
query.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery;
}
query.ResultTypes = ResultType.RelevantResults;
ResultTableCollection results = query.Execute();
ResultTable resultTable = results[Microsoft.SharePoint.Search.Query.ResultType.RelevantResults];
When we run the search we noticed that in the results are documents that the searched text are not in its content but in its properties, such as modified by.
On the full text columns used in the CONTAINS predicate, the MSDN says:
"The full-text column reference is optional. With it, you can specify a single column or a column group against which the CONTAINS predicate is tested. When the full-text column is specified as "ALL" or "*", all indexed text properties are searched. Although the column is not required to be a text property, the results might be meaningless if the column is some other data type. The column name can be either a regular or delimited identifier, and you must separate it from the condition by using a comma. If you do not specify a full-text column, the Contents column, which is the body of the document, is used. "
You know why the search is also made in the properties of the documents ?
You know what is the full text column in the contains predicate so that the search is made only on document content rather than on their properties?
Thanks in advance,
Jorge
We are searching in WSS 3 using the class FullTextSqlQuery.
Code :
FullTextSqlQuery query = new FullTextSqlQuery(site);
string searchQuery =
@"SELECT URL FROM Scope() WHERE SITE = ' AND CONTAINS('administrator') AND isDocument = 1 ORDER BY RANK DESC";
query.QueryText = searchQuery + " ORDER BY RANK DESC";
query.RowLimit = 1000;
query.TrimDuplicates = false;
if (SPSecurity.AuthenticationMode != System.Web.Configuration.AuthenticationMode.Windows)
{
query.AuthenticationType = QueryAuthenticationType.PluggableAuthenticatedQuery;
}
else
{
query.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery;
}
query.ResultTypes = ResultType.RelevantResults;
ResultTableCollection results = query.Execute();
ResultTable resultTable = results[Microsoft.SharePoint.Search.Query.ResultType.RelevantResults];
When we run the search we noticed that in the results are documents that the searched text are not in its content but in its properties, such as modified by.
On the full text columns used in the CONTAINS predicate, the MSDN says:
"The full-text column reference is optional. With it, you can specify a single column or a column group against which the CONTAINS predicate is tested. When the full-text column is specified as "ALL" or "*", all indexed text properties are searched. Although the column is not required to be a text property, the results might be meaningless if the column is some other data type. The column name can be either a regular or delimited identifier, and you must separate it from the condition by using a comma. If you do not specify a full-text column, the Contents column, which is the body of the document, is used. "
You know why the search is also made in the properties of the documents ?
You know what is the full text column in the contains predicate so that the search is made only on document content rather than on their properties?
Thanks in advance,
Jorge