Hi,
I am trying customize SPS search that you can get all documents that have a specific custom property.
everything almost goes well, but the problem is if there are many documents that have same property it returns just the first one. why?
here is a bit of my code:
try
{
PortalContext context = PortalApplication.GetContext(Context);
SPSite IgnitoSiteCollection = SPControl.GetContextSite(Context);
string query = "SELECT \"DAV:href\",\"DAV:displayname\"," +
"\"urn:schemas-microsoft-comfficeffice#Author\"" +
"FROM ( TABLE Portal_Content..Scope() " +
"UNION ALL TABLE Non_Portal_Content..Scope() ) " +
"WHERE (\"urn:schemas.microsoft.com:sharepointortal:isdocument\" = 1)" +
"AND \"urn:schemas-microsoft-comfficeffice#MyProp\" = '" + textbox1.Text + "'";
QueryProvider QProvider = new QueryProvider(context.SearchApplicationName);
DataSet DS = QProvider.Execute(query);
}
I am trying customize SPS search that you can get all documents that have a specific custom property.
everything almost goes well, but the problem is if there are many documents that have same property it returns just the first one. why?
here is a bit of my code:
try
{
PortalContext context = PortalApplication.GetContext(Context);
SPSite IgnitoSiteCollection = SPControl.GetContextSite(Context);
string query = "SELECT \"DAV:href\",\"DAV:displayname\"," +
"\"urn:schemas-microsoft-comfficeffice#Author\"" +
"FROM ( TABLE Portal_Content..Scope() " +
"UNION ALL TABLE Non_Portal_Content..Scope() ) " +
"WHERE (\"urn:schemas.microsoft.com:sharepointortal:isdocument\" = 1)" +
"AND \"urn:schemas-microsoft-comfficeffice#MyProp\" = '" + textbox1.Text + "'";
QueryProvider QProvider = new QueryProvider(context.SearchApplicationName);
DataSet DS = QProvider.Execute(query);
}