Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

CoreResultWebPart display 2 times the result

$
0
0

Hi,

I extend CoreResultWebPart to display my search result in a SPGridView.

I've the result in my grid but in a traditional search result too.

If i extend only WebPart, i've only my grid but my refiners doesn't work.

Here is how i use queryManager

// get the query and settings service proxy
                SearchQueryAndSiteSettingsServiceProxy settingsProxy = SPFarm.Local.ServiceProxies.GetValue<SearchQueryAndSiteSettingsServiceProxy>();

                // get the search service application proxy by name
                SearchServiceApplicationProxy searchProxy = settingsProxy.ApplicationProxies.GetValue<SearchServiceApplicationProxy>("Search Service Application");

                // create QueryManager and LocationList objects
                QueryManager queryManager = new QueryManager();
                LocationList locationList = new LocationList();

                // add the federated location we want
                Location localSearchLocation = new Location("LocalSearchIndex", searchProxy);

                // set the start page and page size
                localSearchLocation.ItemsPerPage = 20;

                // add our managed properties
                localSearchLocation.RequestedProperties = new System.Collections.Specialized.StringCollection() { "title", "test"};

                // add the Location to the LocationList
                locationList.Add(localSearchLocation);

                // set the query
                queryManager.UserQuery = strKey.Trim();
                queryManager.Add(locationList);
                //queryManager.IsTriggered(locationList);
                // make the call to search
                XmlDocument xmlDocument = queryManager.GetResults(locationList);
                
                return ConvertXmlDocumentToDataTable(xmlDocument);
thanks for your help


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>