Integrate Find with Commerce and CMS

Vote:
 

Hi,

I've installed EPiServer.Commerce.FindSearchProvider to both CMS and Commerce Manager. Indexing works fine in Commerce Manager and I can see the indexed documents in Find.

However, I'm not able to get the search to work within CMS, in the Catalog gadget.

I can see the provider in CMS Admin, listed as Products together with Find files, Find pages and Find blocks. All providers are selected and I get results for pages, blocks and files.

No errors are thrown in the console when I search.

Configs\Mediachase.Search.config contains the same configuration in both places

<?xml version="1.0" encoding="utf-8"?>
<Mediachase.Search>
	<SearchProviders defaultProvider="FindSearchProvider">
		<providers>
			<add name="FindSearchProvider" type="EPiServer.Commerce.FindSearchProvider.FindSearchProvider, EPiServer.Commerce.FindSearchProvider" serviceUrl="*********" defaultIndex="*********" />
		</providers>
	</SearchProviders>
	<Indexers basePath="">
		<add name="catalog" type="EPiServer.Commerce.FindSearchProvider.FindSearchIndexBuilder, EPiServer.Commerce.FindSearchProvider" />
	</Indexers>
</Mediachase.Search>

What have I missed?

#86353
May 19, 2014 23:59
Vote:
 

Btw, I have the same serviceUrl and defaultIndex in web.config as well.

#86354
May 20, 2014 0:07
Vote:
 

The indexed documents using FindSearchProvider should be named (the class name) FindDocument. If you cant find that in the index, the find search indexer hasn't done its work very well. Do you get any "warnings" in white text when you rebuild the index? I know there can be problems in the FindSearchProvider when it comes to parsing doubles.

#86534
May 23, 2014 9:23
Vote:
 

No warning. However, I found this in the log while trying to search:

2014-05-22 14:39:47,285 ERROR [admin] EPiServer.Business.Commerce.Providers.ProductSearchProviderBase System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at EPiServer.Commerce.FindSearchProvider.LocalImplementation.SearchResultsImplementation.GetFieldValue[T](Int32 index, String fieldName)
   at Mediachase.Commerce.Website.Search.SearchFilterHelper.SearchEntries(CatalogEntrySearchCriteria criteria, Int32& count, CatalogEntryResponseGroup responseGroup, Boolean cacheResults, TimeSpan cacheTimeout)
   at EPiServer.Business.Commerce.Providers.ProductSearchProviderBase.SearchEntriesInCommerce(String keyword, SearchFilterHelper filter, Int32 pageSize, Boolean cacheResults, TimeSpan cacheTimeout, Boolean getExpired, Boolean getInactive)
   at EPiServer.Business.Commerce.Providers.ProtectedProductSearchProvider.SearchEntriesInCommerce(String keyword, SearchFilterHelper filter, Int32 pageSize, Boolean cacheResults, TimeSpan cacheTimeout)
   at EPiServer.Business.Commerce.Providers.ProductSearchProviderBase.Search(Query query)
 - Error when processing search product catalog query

And there are FindDocuments in the index:

Index ID:  17040
Index Type:  EPiServer_Commerce_FindSearchProvider_FindDocument
Document source:
{
  "$type": "EPiServer.Commerce.FindSearchProvider.FindDocument, EPiServer.Commerce.FindSearchProvider",
  "CatalogEntryId$$number": 17040,
  "CatalogEntryCode$$string": "form-8683",
  "MetaClassName$$string": "Produkt - Form",
  "CatalogEntryType$$string": "product",
  "StartDate$$date": "2014-04-21T18:11:02.333Z",
  "EndDate$$date": "2024-04-21T07:00:00Z",
  "Languages": [
    "da-dk",
    "de-de",
    "en-gb",
    "et-ee",
    "fi-fi",
    "nb-no",
    "pl-pl",
    "sv-se"
  ],
  "Currencies": [],
  "Markets": [],
  "Catalogs": [
    "benders"
  ],
  "Outlines": [
    "benders/structure-36830/structure-36862/product-36903"
  ],
  "CatalogNodes": [
    "product-36903",
    "structure-36830",
    "structure-36862"
  ],
  "Name$$string": "megastone 150 rund - 25300",
  "IsActive$$bool": true,
  "ListPrices": {},
  "SalePrices": {},
  "StringFields": {
    "formname_nolang$$string": "Megastone 150 rund - 25300",
    "displayname_da-dk$$string": "Megastone 150 rund - 25300",
    "displayname_de-de$$string": "Megastone 150 rund - 25300",
    "displayname_en-gb$$string": "Mega 150 round split",
    "formheader_en-gb$$string": "Mega 150 round split",
    "formsubheader_en-gb$$string": "385x220x150",
    "displayname_et-ee$$string": "Megastone 150 rund - 25300",
    "displayname_fi-fi$$string": "Mega 150 pyöreäksi lohkottu",
    "formheader_fi-fi$$string": "Mega 150 pyöreäksi lohkottu",
    "formsubheader_fi-fi$$string": "385x220x150 mm",
    "displayname_nb-no$$string": "Mega 150 rundhuggen",
    "formheader_nb-no$$string": "Mega 150 rundhuggen",
    "formsubheader_nb-no$$string": "385x220x150",
    "displayname_pl-pl$$string": "Megastone 150 rund - 25300",
    "displayname_sv-se$$string": "Megastone 150 rundhuggen",
    "formheader_sv-se$$string": "Megastone 150 rundhuggen",
    "formsubheader_sv-se$$string": "385x220x150 mm"
  },
  "StringCollectionFields": {},
  "IntFields": {},
  "BoolFields": {},
  "LongFields": {},
  "DoubleFields": {},
  "DateTimeFields": {},
  "___types": [
    "EPiServer.Commerce.FindSearchProvider.FindDocument",
    "System.Object"
  ]
}
#86567
May 23, 2014 16:14
Vote:
 

Hi,

Would you mind to send us the catalog? I'm trying with Deparmental catalog (From sample project) and it works fine for the one got indexed. My email is quma at episerver.com.

Regards.

/Q

#86590
May 26, 2014 10:52
Vote:
 

Quan, I'm not able to export the catalog. I'm getting this error "2014-05-28 09:47:05: Specified cast is not valid."

What steps do I need to do for setting up the search, except for what I've already mentioned in this thread? It seems like everything is set up correctly, but it's only internal errors the stops the search from working correctly.

Could there be a mismatch between our content types and the commerce database?

#86709
May 28, 2014 19:03
Vote:
 

This should not be the case, because Commerce will synchronize the content types with meta classes at startup. And Catalog import/export system should work without any dependencies on the content types. Also, the error message is strange - at least for me as I have never seen it before.

My suggestion:

- Try to restart your site by IIS to see if it works.

If it does not, you might need to submit a support ticket - we might have to use the nuke option - to dump entire database.

Regards.

/Q

#86710
May 28, 2014 19:33
Vote:
 

I'm emailing you a commerce database backup instead,

#86711
May 28, 2014 19:37
Vote:
 

I have this exact same problem. When I try to search, "Could not find search provider:  " is logged from EPiServer.Shell.UI.Rest.SearchResultStore. So it seems that it's missing some search provider for Find.

If you look up in your database, I'm also missing anything Find+Commerce:

SELECT string01
FROM [MyEpiserverDatabase].[dbo].[tblBigTable]
where storename = 'EPiServer.Shell.Search.SearchProviderSetting'


The providers you get from this all seem to be ISearchProvider, and the FindSearchProvider is not. Is this supposed to work at all? :-S

The search works fine for pages, blocks, media. And for products within the commerce manager. And in the Index overview.

#86861
Edited, Jun 03, 2014 18:04
Vote:
 

Well, then it's not the same error. My search provider is responding, but with an error.

#86863
Jun 03, 2014 18:17
Vote:
 

Oh. Oh well, fair enuff.

What do you have in your database when doing the query above? And what's the name of the providerId given in the URL when searching from the commerce catalog/catalog gadget?

#86864
Jun 03, 2014 18:21
Vote:
 
EPiServer.Business.Commerce.Providers.ProtectedProductSearchProvider
EPiServer.Cms.Shell.Search.BlockSearchProvider
EPiServer.Cms.Shell.Search.FileSearchProvider
EPiServer.Cms.Shell.Search.PageSearchProvider
EPiServer.Find.Cms.SearchProviders.EnterpriseMediaSearchProvider
EPiServer.Find.Cms.SearchProviders.EnterpriseBlockSearchProvider
EPiServer.Find.Cms.SearchProviders.EnterprisePageSearchProvider
EPiServer.Shell.Navigation.Providers.NavigationSearchProvider

So it's there, EPiServer.Business.Commerce.Providers.ProtectedProductSearchProvider. I guess this provider in turn talks to the Find provider that's configured in Mediachase.Search.config.

The url is /shell/Stores/searchresults/?parameters=%7B%22filterOnDeleted%22%3Atrue%7D&filterOnCulture=false&searchRoots=-1073741823__CatalogContent%2C7011&providerId=EPiServer_Business_Commerce_Providers_ProtectedProductSearchProvider&searchQuery=a product&dojo.preventCache=1401813508979

#86865
Jun 03, 2014 18:39
Vote:
 

Hm, I've got that one too, but it's not appended onto my URL (the rest is the same).

If you quickly Ctrl-shift-F through your solutions after "ProtectedProductSearchProvider", is it configured to be used somewhere? Cus I'm kinda guessing i'm missing some config, but i really cannot figure out what or where...

#86866
Jun 03, 2014 18:42
Vote:
 

It's not. Try to re-install the Commerce and/or Find Commerce integration packages.

#86867
Jun 03, 2014 18:45
Vote:
 

Just following up on this issue since the linked support ticket is solved. Rows in table CatalogEntryRelation missed a value for Quantity and GroupName (they were null).

Once the values were set ('1' and default) the search started to work.

We will look into to handle the null values in a better way to avoid similar issues in the future.

#87366
Jun 11, 2014 17:30
Vote:
 

Thank you Per. You beat me to it, was just about to post the same information here.

#87367
Jun 11, 2014 17:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.