What is the best way to search products including custom fields?
For instance, I have a product definition with a custom field and the default long description. Now I want to enable visitors to search products in my store using plain old keywords in a search bar and include the text in the long description and my custom field.
I could 'simply' use the Product entity to search, but I get a feeling that that's not very performant. In addition, I know that RavenDB has 'near match' functionality that I would like to use. (for instance searching for 'snwoman' would also match 'snowman' with a lower certainty)
I assume it would involve creating a custom indexer or whatnow, but I haven't been able to find any documentation on how to this.
So what I hear you're saying is that you would like to implement a freetext search? That "can" be tricky depending on what you're aiming for. First of all you're going to create your own search logic directly and how it should interprept your search term.
There are different ways you can go to make your search but I am certain that you have to use uCommerce's Product document. I'm not sure if uCommerce already have some statuc indexes in Ravendb but that should be fairly easy to figure out.
I ended up creating a custom Lucene index using the ISimpleDataService interface. Works pretty well (though I'm still not exactly sure how Lucene weighs the search results)
Searching products
What is the best way to search products including custom fields?
For instance, I have a product definition with a custom field and the default long description. Now I want to enable visitors to search products in my store using plain old keywords in a search bar and include the text in the long description and my custom field.
I could 'simply' use the Product entity to search, but I get a feeling that that's not very performant. In addition, I know that RavenDB has 'near match' functionality that I would like to use. (for instance searching for 'snwoman' would also match 'snowman' with a lower certainty)
I assume it would involve creating a custom indexer or whatnow, but I haven't been able to find any documentation on how to this.
I've read the content of this post:
http://docs.ucommerce.net/ucommerce/v6/getting-started/search-foundation/search-library.html
But it speaks only of searching using Facets.
I'm assuming someone out there must've done something similar to this so any any help on the subject would be greatly appreciated.
Hi Robert,
So what I hear you're saying is that you would like to implement a freetext search? That "can" be tricky depending on what you're aiming for. First of all you're going to create your own search logic directly and how it should interprept your search term.
First of all I would recommend reading this: http://ravendb.net/docs/article-page/2.5/csharp/client-api/querying/static-indexes/searching
There are different ways you can go to make your search but I am certain that you have to use uCommerce's Product document. I'm not sure if uCommerce already have some statuc indexes in Ravendb but that should be fairly easy to figure out.
Best regards
Martin
Hi Robert, how did you get along with searching products? What approach did you take? I have the same requirements here and stumbled upon this post, but it's from a while ago http://www.diplo.co.uk/blog/2013/1/23/indexing-ucommerce-products-in-umbraco-using-lucenenet.aspx
I ended up creating a custom Lucene index using the ISimpleDataService interface. Works pretty well (though I'm still not exactly sure how Lucene weighs the search results)
Ah oke, nice. So you also took the Lucene approach. Would you mind sharing (parts of) your code?
Thank you for sharing what you did. Could you mark the topic as solved please?
is working on a reply...