The gadget use the index-based search provider, so no, there is no direct query against DB. The filter entries by keyword might be a nice thing to have but that is not supported out of the box
Ok. In our solution we have implemented Find in following manner:
There is a class
public class FindProduct {}
That wraps
public class ProductBase : ProductContent
Indexing is done by
public class SiteReindexer : CommerceReIndexInformation
Hooking up Find in the Mediachase.Search.config was done like described here
Index exists when done through CMS job but still nothing gets listed while typing in the search box. I am guessing that instaed of FindSearchIndexBuilder we might have to use our custom search provider?
Is that correct?
I didn't quite see it mentioned on the page you linked, but did you change the provider on the front end site as well? There are two Mediachase.Search.config files. One in the CM project and one in the Front End project.
The only (official) way to get search provider to work with Find is to use FindSearchProvider. and that uses Find as an backend, it does not understand the content types, or the indexer.
And most importantly the UI does not support passing custom query to the search provider.
Oh, sorry. I missed the part that it is POCOs that are being indexed and not the IContent.
Yeah, a custom search provider would be necessary in that case.
Or looking into if it is really necessary to index your own POCOs instead of the IContent.
I'd look into the latter first. :)
We ended up having two indexing jobs. One that indexes content done 'out of the box'. This one creates index used by catalog widget. Second one is custom that is responsible for search results.
Main reason for this is the structure of our catalog.
Do you have two documents in the Find index for each languageversion for each product in that case? (One POCO and one "IContent")
Yes. For now it has to stay that way. My understanding is that there was an issue with Find and include clause that didn't work out nice in our case.
Ok, just as a reference for future visitors to this thread, you'll have to consider the pricing tiers with Episerver Find when doing an approach like this. Doubling the amount of documents in the index for all your products isn't always an option for your customers.
The pricing tiers can be found here: https://www.episerver.com/actions/order-episerver-find/
An alternative if you need to index POCOs for your products but still need the product search (both in CM and in the catalog gadget) is to run a dual index setup. Find for your POCO products and other regular content, for use in the front end. And a complimentary Lucene index for products that the admin side of things uses for product catalog searching.
Is there a way of implementing search directly against the DB?
In a similar way that products get shown by clicking on catalog nodes but filtering on them instead?