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"?>
<add name="FindSearchProvider" type="EPiServer.Commerce.FindSearchProvider.FindSearchProvider, EPiServer.Commerce.FindSearchProvider" serviceUrl="*********" defaultIndex="*********" />
<add name="catalog" type="EPiServer.Commerce.FindSearchProvider.FindSearchIndexBuilder, EPiServer.Commerce.FindSearchProvider" />
What have I missed?
Btw, I have the same serviceUrl and defaultIndex in web.config as well.
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.
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
"$type": "EPiServer.Commerce.FindSearchProvider.FindDocument, EPiServer.Commerce.FindSearchProvider",
"MetaClassName$$string": "Produkt - Form",
"Name$$string": "megastone 150 rund - 25300",
"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",
"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",
"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"
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.
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?
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.
- 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.
I'm emailing you a commerce database backup instead,
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:
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.
Well, then it's not the same error. My search provider is responding, but with an error.
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?
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
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...
It's not. Try to re-install the Commerce and/or Find Commerce integration packages.
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.
Thank you Per. You beat me to it, was just about to post the same information here.