Integrate Find with Commerce and CMS

Member since: 2007

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
  • Member since: 2007

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

    #86354 May 20, 2014 0:07
  • 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
  • Member since: 2007

    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
  • Member since: 2011

    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
  • Member since: 2007

    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
  • Member since: 2011

    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
  • Member since: 2007

    I'm emailing you a commerce database backup instead,

    #86711 May 28, 2014 19:37
  • Member since: 2011

    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
  • Member since: 2007

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

    #86863 Jun 03, 2014 18:17
  • Member since: 2011

    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
First   1 2   Last