Home » Sharepoint

SharePoint Advance Search Web Part configuration


I try to use an Advanced Search Web Part to search in a particulare scope which is a single list.

(1) I have created a contact list.

(2) I created on my search server a special scope whith a scope rule which is pointing to my list

(e.g. Folder = http://intranet/Lists/STAFF_CONTACT_LIST/AllItems.aspx)

(3) I edit webpart and put in the Scope label and Scope section label the myScope name.

But he gives me the error message inside the webpart zone: Object reference not set to an instance of an object.

Well that's a nice hint but I thought the Object reference is the scope ...?

Thanks for any help related to this problem :-)





3 Answers Found


Answer 1

Hi Mia,

The web  part you are trying to edit  is the advanced  Search web part.

The "Scope label" is just a label  that will display "Narrow this search..." by default. The scope  section label is a label that will displayed in front of the checkboxes for all the scopes, assuming you have selected the "Show the scope picker" checkbox.

the results of the advanced webpart  will by default be displayed in the /<SearchCenterUrl>/Pages/results.aspx page (you can check this in the Results url textbox in the miscellaneous section  of the web part  properties).
If you want only want to show results from a single  scope after searching from the advanced search webpart the best thing you can do is create a new search  results page, for instance  named advancedresults.aspx (do this in the pages library of the search center).
On the new page, edit the settings of the search core results webpart and under Location properties fill in the name of the scope in the scope textbox.

Then change the Results url of the advanced search web part to /<SearchCenterUrl>/Pages/advancedresults.aspx.
Also change the Results url of the Search box web part on the advancedresults.aspx page to link to the advancedresults.aspx page.

That should give you the results you want.

Good luck!


Answer 2

Hi Mirjam

At first thanks for your feedback :-)

Well I have done a solution in this way that I have used the search  Core Result webpart  and it works now fine.

I have also restarted the service and I think this was the problem, because I never got any search results.

It works now all fine but I need to get AllItems.aspx out of my scope  and I don't know how?

What I will do is to search in my contact list  for contacts.

I am using a Search Box webpart and the Core Result webpart. It works fine, but I want to get

only the entries insite the list but in the moment the result shows me also the contact  list as an result...

Any ideas would be more as appreciate :-)))




Answer 3


I'm also need some help  regarding the adnanced search  web part  which i see you have customized...

i want to add some custom properties which are managed metadata (taxonomy) and make sure that when the user choose to filter the search result by that property - he gets only the relevant results.

Can you point me how to add the property in the web  part so it will work?




Hi, All!

I have a problem with getting values from resources. In advanced search i trying to modify web-part. under properties i see default xml with some attributes, like:

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<LangDef DisplayName="English" LangID="en"/>
<Language LangRef="en"/>
<PropertyDef Name="Path" DataType="integer" DisplayName="URL"/>

well i tried (for test) change "DisplayName" to some value from resource (which dynamic modified when user change display language) with next code:

<LangDef DisplayName="$Resources:core,Company" LangID="en"/>

I see, when refresh page, near checkbox $Resources:core,Company instead only Company (from resources). Quotation, marks semicolon - nothing helps me.

For last i tried to get value with xsl in next code:


 <xsl:value-of select="concat('&lt;LangDef DisplayName=&quot;','nmfgh','&quot; LangID=&quot;en&quot; /&gt;')" disable-output-escaping="yes"/>


and saw nothing.

Next i just trying to copy and paste same what was default in properties and save that. and values have become static: If i did it in english, on other langs i can see only english values, if in other langs, in english i see only from other.

Can anyone helps me?


I have configured a page in SP2010 with an advanced scope web part.

I have enabled the scope picker from the "advanced search" scope group and adding a new scope to that group in the site collection settings.

The advanced search web part is targetted to a new results page containing the core results web part.

When I perform a search for string test using one of the scopes that I have selected the results page is called as follows.


No results are rendered.

What I don't quite understand is I thought that the querystring should actually be.


Which when entered manually works.

So it sort of seems that the advanced search web part is rendering the wrong querystring!!

The search centre is enterprise template (not fast) and sharepoint server search is configured not fast search.




I have a site collection that I upgraded from MOSS 2007 to a new SharePoint 2010 farm, by content DB attachment.

I try to create a search page on this site collection root site in SharePoint Server 2010. In this page, I put an advanced search webpart (sorry I dont know the exact ame in english, shoudl be advanced search area), and the search results webpart (main search results).

In the search results URL field, I have put the URL to my page.

When I type a query in the "all these words" field of the search form, the query seems to be sent in GET, and I get correct results in the results webpart.

Then if I edit the advanced search webpart properties and remove any of the keywords fields (exact sentence, any word, none of these words), and then type again the same query in the All these words fields, it looks like the query is sent in POST, and I don't get anymore result returned (instead, the message "no result available, either no query was specified or the equery was coming from advanced search, etc.")

What do I miss ?

Many thanks, and regards


Dear collegs,

I have one issue and hope that somebody maybe can help.

Namely I want to implement Google search inside SharePoint. For that purpose I downloaded this FREE google search Web Part :

http://www.sharepoint-blogs.com/post/2010/01/31/FREE-SharePoint-Web-Part-for-Google-Search.aspx  .

Also I did installation according to the tutorial which is on the site and everything was fine.

The problem starts when I want to search inside my SharePoint. This google search box has two options :

- Web

- http://mySharePoint

If you use Web everyhing works fine, the problem is when I want to search inside SharePoint and use http://mySharePoint options, than as result always get nothing.

Do you maybe have an idea why this is not good and what need to change.




I've recently built a custom SharePoint 2007 search web part using the FullTextSqlQuery class (thanks to Corey Roth for the Guidance).  My only question now is how do I include the document icon in the search return?  My full code is below:
















































publicclassCustomDateSearch : System.Web.UI.WebControls.WebParts.WebPart



Label lblDateSearch;


Label lblQueryResults;


DropDownList ddlYear;


Button btnSearch;


DateTime dtToday;


DateTime dtPastYear;


DateTime dtPast2Years;


DateTime dtPast5Years;


String strToday;


String strPastYear;


String strPast2Years;


String strPast5Years;


String strSelectedValue;


String strSelectedItem;



public CustomDateSearch()




protectedoverridevoid CreateChildControls()





//DateTime Variables

dtToday =


dtPastYear = dtToday.AddYears(-1);

dtPast2Years = dtToday.AddYears(-2);

dtPast5Years = dtToday.AddYears(-5);


//String Variables

strToday = dtToday.ToString().Remove(9);

strPastYear = dtPastYear.ToString().Remove(9);

strPast2Years = dtPast2Years.ToString().Remove(9);

strPast5Years = dtPast5Years.ToString().Remove(9);



lblDateSearch =


lblDateSearch.Text =

"Year Range Search: ";





//Drop Down List

ddlYear =



newListItem("Select a Search Option", "0"));


newListItem("Past Year", strPastYear));


newListItem("Past 2 Years", strPast2Years));


newListItem("Past 5 Years", strPast5Years));





//Search Button

btnSearch =


btnSearch.Text =


btnSearch.Click +=





//Test Label

lblQueryResults =


lblQueryResults.ForeColor =







void cmdSearch_Click(object sender, EventArgs e)


strSelectedValue = ddlYear.SelectedValue.ToString();

strSelectedItem = ddlYear.SelectedItem.ToString();


if (strSelectedValue != "0")


lblQueryResults.Text =

" ";






lblQueryResults.Text =

" *You Must Select a Search Option! ";




privatevoid fullTextSqlQueryExecute(string strQueryText)



FullTextSqlQuery ftQuery= newFullTextSqlQuery(ServerContext.Current);



if (strQueryText == "Past Year")


ftQuery.QueryText =

"SELECT Title, Description, Write, HitHighlightedProperties, Author, Path, DocumentDate FROM SCOPE() WHERE DocumentDate >=DATEADD (Year, -1, GETGMTDATE()) ORDER BY DocumentDate desc --";



elseif (strQueryText == "Past 2 Years")


ftQuery.QueryText =

"SELECT Title, Description, Write, HitHighlightedProperties, Author, Path, DocumentDate FROM SCOPE() WHERE DocumentDate >=DATEADD (Year, -2, GETGMTDATE()) ORDER BY DocumentDate desc --";



elseif (strQueryText == "Past 5 Years")


ftQuery.QueryText =

"SELECT Title, Description, Write, HitHighlightedProperties, Author, Path, DocumentDate FROM SCOPE() WHERE DocumentDate >=DATEADD (Year, -5, GETGMTDATE()) ORDER BY DocumentDate desc --";



ftQuery.ResultTypes =



ResultTableCollection oResultCollection = ftQuery.Execute();


if ((int)ResultType.RelevantResults != 0)


lblQueryResults.Text =

" Results Returned: ";

lblQueryResults.ForeColor =


lblQueryResults.Font.Bold =






lblQueryResults.Text =

" No Results Returned ";



// Execute the query and load the results into a datatable //


ResultTable oResult = oResultCollection[ResultType.RelevantResults];


DataTable dtResults = newDataTable();

dtResults.TableName =





DataSet ds = newDataSet("All_Results");



DataGrid datagrid = newDataGrid();

datagrid.DataSource = ds.Tables[0];


//General Datgrid Formatting

datagrid.GridLines =


datagrid.CellPadding = 4;

datagrid.Width =


datagrid.ItemStyle.ForeColor =


datagrid.ItemStyle.Font.Size =


datagrid.ItemStyle.Font.Name =


datagrid.AutoGenerateColumns =



//Document Name Link


HyperLinkColumn colDocNameLink = newHyperLinkColumn();

colDocNameLink.DataTextField =


colDocNameLink.DataNavigateUrlField =




//Document Name


BoundColumn colDocName = newBoundColumn();

colDocName.DataField =




//Highlight (No Data Shows!)


BoundColumn colHighLight = newBoundColumn();

colHighLight.DataField =







HyperLinkColumn colPath = newHyperLinkColumn();

colPath.DataTextField =


colPath.ItemStyle.ForeColor =


colPath.DataNavigateUrlField =






BoundColumn colAuthor = newBoundColumn();

colAuthor.DataField =


colAuthor.ItemStyle.ForeColor =




//Document Date


BoundColumn colDocDate = newBoundColumn();

colDocDate.DataField =


colDocDate.DataFormatString =


colDocDate.ItemStyle.ForeColor =




//Bind and Add









I enable the Discovered Definition of the core results web part and set the location to Local Search Results and Local FAST Search Results. I display the results in xml format and I notice that there is no node for Discovered Definition. In MOSS 2007, the Discovered Definition is generated during crawl. How about in SharePoint 2010? Is the Discovered Definition is dependent on the crawl or I need to enable a feature in the site collection or central administration.

It seems that a sharepoint or choice filter web part can connect to any list object in sharepoint that is displayed in a web part on a page but the picture library.  I want to allow the user to select a value so that only the image that applies is viewed (along with any correlating information stored in its library).

Is there a work around for this?  I've looked all over the web and can only find where someone else has asked in another forum and has not yet received an answer.  I'm sure this isn't the first time this has come up, so what are folks doing to accomplish this?


I have created my first visual web part in SP2010.  In 2007 version I didn't use user controls so all of my code was in a single file for the most part.  Now I've separated out the code.  Everything works great and I like this a lot better (more like traditional ASP.NET development) with one exception.  In my bootstrap .cs file (I call it that because it does nothing but load the user control file) I put all of my custom web part properties.  Then in my web part code-behind I reference them thru an instance of the containing class.  I must have something incorrectly configured because none of the changes to the properties at runtime are getting updated in the code.  Here's a filtered view of how I have it wired together:

Sample property in the top level .cs file:

privatestring m_ImagePath = "sites/myapp/images1/branded_image.png";
   WebDisplayName("Relative path to header image"),
   WebDescription("Relative path to header image"),
   Category("Custom Configuration")]
   publicstring ImagePath
    get { return m_ImagePath; }
    set { m_ImagePath = value; }

Then, in my user control .cs file I have this:

TopLevelClassName bootstrap;

public UserControConstructor()
  bootstrap = new TopLevelClassName ();

Then throughout my code in the user control I reference the web part properties like this, for example:

Image1.ImageUrl = bootstrap.ImagePath;

The values are loaded fine, but never update in the user control if they are changed in the SharePoint page. 

Thoughts and guidance is much appreciated!


Hi there,

Has anybody else seen the issue whereby a QueryString web part does not get displayed (even on edit page) with a rich content area? If I add a Business Connectivity web part to the same error, then edit the properties of that web part, suddenly the QueryString webpart(s) all appear. I ccan then edit the properties of the QueryString web part. that worked for a while, now that workaround has stopped working unfortunately. Any ideas?

(I presume the web part is indeed still there, as the other web parts say they are still connected to it).




Hello everyone.


I have a MOSS 2010 Intranet portal and a Search Center.  When I search for a document or an item I get the normal results page with the refinement web part filters. However, I cannot filter my results by site, but only by the rest of the filter categories. For example I can filter by Result Type, Author, and Modified Date but not by Site.  When I do filter by site I get the message



"We did not find any results for "..."



•Ensure words are spelled correctly.

•Try using synonyms or related searches.

•Try broadening your search by searching from a different site.

•Try removing search refinements or using more general keywords.

Additional resources:

•Get additional search tips by visiting Search Help

•If you cannot find a page that you know exists, contact your administrator."


I also notice that the Site category filter can actually show the correct refinements by site, based on my search term results, but when I click on these by-site filters I get the above message.


The sites are also on https




I have not made any modifications to my default filter category definition xml, inside the refinement web part. It is the default one that the search center is using.

I have hidden the default "this site" scopes from my sites and have replaced those with my custom scopes.


Is there a way to make filtering by site available to my search results?

Should I edit the   filter category definition xml, or is there another reason that I get the above message?

I have been through the MSDN and the rest of the blogs and discussions but cannot fix this.


Hello everyone!

First I´d like to apologize for my poor english.

My cenario is: I have a Windows 2008 R2 Server with Sharepoint 2010 already installed, and I have to install TFS2010, and during TFS Advanced Configuration using TFSSetup account the wizard is able to find Sharepoint URLs but when I try to validate the wizard shows the fallowing error:

TF250004: The SharePoint Products installation is either corrupt or is not valid. Verify that SharePoint Products is a supported version and is functioning properly, and then try again.

Another team installed Sharepoint 2010, so if I try to run advanced configuration using the account who installed Sharepoint 2010 the error is gone. Which permissions I need to TFSSetup account? TFSSetup is farm administrator for Sharepoint 2010. I don´t want to run advanced configuration using Sharepoint installtion account.

Anyone can help me?



I have a few pages which use the Search Box web part.  The web parts have been setup to use a custom Search Scope category I created.  This all works great.  My question is when the user submits a search through the web part and is directed to the OSSSearchResults.aspx page, they are then presented with the search box on the OSSSearchResults.aspx page which does not default to the scope the search was originally directed against.  What is the easiest way to accomplish this?


I have a question about advanced search in sharepoint 2010 would love if you could help me:

I have a document management system that contains files of different types.

Performing a standard search system finds documents,

Advanced search performed on the document properties the system can not find such documents tiff.

We installed ifilter tiff by the following link:

But it does not work.

Maybe you have another solution for me?

Thank you.



I have a question about advanced search that field a Date,

When searching the date field the sharepoint can not find any document and writes:

"No results found appropriate."

When going to standart search the sharepoint find documents also in date search .

in central administration in metadata properties- the  Data of the field is set.

What could be the problem?

How to add date picker in Sharepoint 2010 Advance search

Hi All,

Has anyone tried Advanced Search with multiple languages content? I have English and Arabic content in my site and when I search based on metadata of the Arabic document, the Arabic document throws up. But when I search by Detected Langauge by Arabic, it does not work. By English, it works fine. Any one has tried this? In many forums, they have not really specified as something to be done in specific. I infact also have the Arabic language pack for SharePoint 2010 configured.


My Advanced search box webpart return result from all the web appications and not just the one that it is in, i know i can create scope and spcify rules on it but i dont see an optoin of forcing
only this instance of web part to use a spific scope.

1. any way i can force it to use a scope behind the scenes instead of having the user select it.
2.i tried to use search core results web part but  ASB webpart is not open to connections even though in the properties i select "Allow connection", any way to make this combination work
3.since all my web application are using the same Search service appliction, could that be the reason that the ASB is returns results from those sites as well or is it that it returns result from all the web application in the farm?
3. Is there any place on the internet where i can find documentation on all the web parts.




Anybody suggest me some resource where i can find information regarding Sharepoint Foundation Boolean/Advanced Search as per my requiremnt for which am new to sharepoint 2010?

Thanks in advance !!!


I have a choice filter web part where in I have months like Jan,Feb,Mar etc and a excel web access web part.

The choices in the filter web part should determine the URL of the workbook for the excel web access web part.
In the filter web part I gave the choices as Jan;http://sitename:port/ExcelList/MyExcel.xlsx where "ExcelList" is the library that stores the excel files for each of the months. But the excel web part always says that "The file selected couldnt not be found".

Is it possible for me to know the actual URL getting passed to the excel web access web part?

Pl suggest if there is a better way to do this.


I gave myself full rights to the inetpub diredctory on the web server. Now when I add athe ECTS Configuration Web Part to the page and enter my values, hiot OK I get:

'An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

The name of the management URL in the documentation should be

of course I substituted my internal url for http://collab

and populated the fields correctly. Is there anyway to GET BETTER ERROR MESSAGES??

<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure