Simbios
asked on
Your search cannot be completed because this site is not assigned to an indexer
Hello, I am trying to do a search, on Sharepoint 2010, Enterprise and I have this error
Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information.
I searched on internet, and find links about sp 2007, and it seems it works different, I havent been able to set this up in sharepoint 2010.
Thanks
protected void Page_Load(object sender, EventArgs e)
{
List<SPListItem> lst = GetListItemsFromFTSQuery() ;
GrvSearch.DataSource = lst;
GrvSearch.DataBind();
}
public static List<SPListItem> GetListItemsFromFTSQuery()
{
string qry = HttpContext.Current.Reques t.QueryStr ing["q"];
List<SPListItem> items = new List<SPListItem>();
DataTable retResults = new DataTable();
using (SPSite site = SPContext.Current.Site)
{
FullTextSqlQuery fts = new FullTextSqlQuery(site);
fts.QueryText = "SELECT owsItemURL,Title,FileExten sion,Conte ntType,Cre ated,LastM odifiedTim e,Path FROM SCOPE() " +
"WHERE (CONTAINS(Path,'\"/Lists/ \"')) " +
"AND (CONTAINS(Title," + qry + ")) ";
fts.ResultTypes = ResultType.RelevantResults ;
fts.RowLimit = 300;
ResultTableCollection rtc = fts.Execute();
if (rtc.Count > 0)
{
using (ResultTable relevantResults = rtc[ResultType.RelevantRes ults])
retResults.Load(relevantRe sults, LoadOption.OverwriteChange s);
foreach (DataRow row in retResults.Rows)
{
if (row["ContentType"].ToStri ng() == "Item")
{
using (SPSite lookupSite = new SPSite(row["owsItemUrl"].T oString()) )
{
using (SPWeb web = lookupSite.OpenWeb())
{
SPFile file = web.GetFile(row["owsItemUr l"].ToStri ng());
items.Add(file.Item);
}
}
}
}
}
return items;
}
}
Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information.
I searched on internet, and find links about sp 2007, and it seems it works different, I havent been able to set this up in sharepoint 2010.
Thanks
protected void Page_Load(object sender, EventArgs e)
{
List<SPListItem> lst = GetListItemsFromFTSQuery()
GrvSearch.DataSource = lst;
GrvSearch.DataBind();
}
public static List<SPListItem> GetListItemsFromFTSQuery()
{
string qry = HttpContext.Current.Reques
List<SPListItem> items = new List<SPListItem>();
DataTable retResults = new DataTable();
using (SPSite site = SPContext.Current.Site)
{
FullTextSqlQuery fts = new FullTextSqlQuery(site);
fts.QueryText = "SELECT owsItemURL,Title,FileExten
"WHERE (CONTAINS(Path,'\"/Lists/ \"')) " +
"AND (CONTAINS(Title," + qry + ")) ";
fts.ResultTypes = ResultType.RelevantResults
fts.RowLimit = 300;
ResultTableCollection rtc = fts.Execute();
if (rtc.Count > 0)
{
using (ResultTable relevantResults = rtc[ResultType.RelevantRes
retResults.Load(relevantRe
foreach (DataRow row in retResults.Rows)
{
if (row["ContentType"].ToStri
{
using (SPSite lookupSite = new SPSite(row["owsItemUrl"].T
{
using (SPWeb web = lookupSite.OpenWeb())
{
SPFile file = web.GetFile(row["owsItemUr
items.Add(file.Item);
}
}
}
}
}
return items;
}
}
Do you have a search service app deployed?
ASKER
the standard search so I suppose yet, but please tell me how can I verify that.
Thanks
Thanks
App management - manage service applications. Do you are search in the list?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Why are you using Foundation search if you have a full version of SharePoint??
ASKER
I dont know, in the manage content database, the only option for search says, Select a Search Foundation Server! there are no more options
ASKER
found the solution