propertiesToReturn
I have added the propertiesToReturn to the webconfig and referenced a property that I added in the Catalog Schema manager. This works as expected in all areas of the site except Search. If I put one of my custom properties in the string then Search returns an error (and no longer works) - all other parts of the site work however. If I remove my custom property from the string then Search works normally.
This is all being done within the latest starter site.
Please Advise.
[495 byte] By [
Xcel] at [2008-2-23]
Has anybody been able to configure the propertiesToReturn element in web.config with a custom property and have the Search functionality still work?
Can you post the error message?
Error from the Event Viewer:
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 11/27/2006
Time: 10:23:19 AM
User: N/A
Computer: SHUTTLE
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/27/2006 10:23:19 AM
Event time (UTC): 11/27/2006 3:23:19 PM
Event ID: b8aaba4b533944efb552a1bcdfac7f2f
Event sequence: 23
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/DEPOTB2B-2-128091145639429336
Trust level: Full
Application Virtual Path: /DEPOTB2B
Application Path: C:\Inetpub\wwwroot\DEPOTB2B\
Machine name: SHUTTLE
Process information:
Process ID: 240
Process name: w3wp.exe
Account name: XCELSOFTWARE\CSRunTimeUser
Exception information:
Exception type: CatalogDatabaseException
Exception message: Search failed.
Request information:
Request URL: https://192.168.1.72/DEPOTB2B/Search.aspx
Request path: /DEPOTB2B/Search.aspx
User host address: 192.168.1.122
User: jdipilato@xcelsoftware.com
Is authenticated: True
Authentication Type: Forms
Thread account name: XCELSOFTWARE\CSRunTimeUser
Thread information:
Thread ID: 12
Thread account name: XCELSOFTWARE\CSRunTimeUser
Is impersonating: False
Stack trace: at Microsoft.CommerceServer.Catalog.Internal.CommonHelpers.Search(CatalogExecutionContext executionContext, StringCollection catalogsToSearchCollection, String sqlClause, String ftsPhrase, String advancedFtsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive, Int32& totalRecords, Boolean returnTotalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CommonHelpers.Search(CatalogExecutionContext executionContext, StringCollection catalogsToSearchCollection, String sqlClause, String ftsPhrase, String advancedFtsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive, Int32& totalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CatalogContext.Search(CatalogExecutionContext catalogExecutionContext, StringCollection catalogsToSearch, String sqlClause, String ftsPhrase, String advancedFtsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive, Int32& totalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CatalogSearch.Search(Int32& totalRecords, Boolean returnTotalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase.SearchWithCount(CatalogSearchParameters catalogSearchParameters, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, Int32& totalRecords)
at Microsoft.CommerceServer.Catalog.CatalogSearch.Search(Int32& totalRecords)
at CommerceComponents.FreeTextSearchDataSource.ExecuteSearch(Int32& totalRecords)
at CommerceComponents.CatalogDataSource.CatalogSearchDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.GridView.DataBind()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Xcel wrote: |
| Has anybody been able to configure the propertiesToReturn element in web.config with a custom property and have the Search functionality still work? |
|
I have been able to create a custom property, assign it to a product definition and execute a search.
Can you describe the steps you used to create your custom property and assign it to your product definitions? Also, if you could provide the value you are setting for propertiesToReturn that would be helpful. We might need a SQL trace of the search operation.
Cheers,
Joe
1. Created a Property Definition Image_FileName
2. Assigned it to a Product Definition
3. Web.Config - Image_filename being the field from the Property Definition. The interesting thing being it works in the product list if I browse through using the navigation bar, just dies if I click the Search button.
<
commerceSite requireSSL="true" enableExpressCheckout="true" persistAnonymousBaskets="false" rewriteProductUrls="true" assetLocation="~/" propertiesToReturn="CategoryName,ProductID,CatalogName,i_ClassType,DisplayName,cy_list_price,Image_Filename" ><
supportedLanguages><
add name="en-US" isDefault="true"><
compatibleLanguages><
add name="en" includeChildren="true"/></
compatibleLanguages></
add><
add name="ja-JP"><
compatibleLanguages><
add name="ja" includeChildren="true"/></
compatibleLanguages></
add><
add name="fr-FR"><
compatibleLanguages><
add name="fr" includeChildren="true"/></
compatibleLanguages></
add><
add name="de-DE"><
compatibleLanguages><
add name="de" includeChildren="true"/></
compatibleLanguages></
add></
supportedLanguages></
commerceSite>Specifically I'm interested in the steps you took to create the property definition, what values you set for each, the steps you took to add the property to your product definitions. If you don't have the exact repro steps then you could send a SQL trace.
The Adventure Works catalog that ships with the Starter Site has an Image_Filename property already so you either aren't using that catalog or have made other changes already. In order to find out what's wrong I'll need to reproduce your problem.
I am not using the Adventure Works catalog.
Also, keep in mind the the PropertiesToReturn field worked properly if I used the Navigation Control to get to the product list, my images showed, it just fails when using the Search functionality. Not sure if you tried this or not.
I am sorry I thought I was thorough on the last steps.
If you tell me how you want the SQL Trace I can send you that - the one trace I have is fairly large so I may have to email it to you.
Please Advise.
In the SQL trace, please search for a call to stored procedure ctlg_GetResults or ctlg_GetResults_for_SingleCatalog. Once you find the call, run that query in "SQL Query Analayzer" on the ProductCatlaog database and send us the results.
Hi,
I have a SQL Trace however the forum does not accept file attachment.
I have found the ctlg_GetResults call in the Trace however I just see the parameter names the stored procedure is looking for and not the values getting passed in - so I can not run this in the query analyzer.
Please Advise.
I have done some more poking around.
We have Inventory enabled on the Catalog - from looking through some of the Stored Procedures I see an InventoryPropertiesToReturn variable getting manipulated.
I wonder if that is where the problem lies?
In your testing did you have Inventory Enabled?
Xcel.
I managed to get this to work.
What I did was modify the search.aspx code by rewriting the lines of code below and hard-coding the propertiesToReturn to match my web.config file.
//this.SearchDataSource.SearchOptions.PropertiesToReturn =
//SiteContext.Configuration.PropertiesToReturn;this.SearchDataSource.SearchOptions.PropertiesToReturn ="CategoryName,ProductID,CatalogName,i_ClassType,DisplayName,cy_list_price,Image_FileName";
Xcel