appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.9k stars 466 forks source link

E-commerce: Dealing with Variable Product Attributes/Features #437

Closed coommark closed 6 years ago

coommark commented 6 years ago

I'm not sure if this is a question or a request for enhancement, I apologize if this belongs to StackOverflow. Kindly help point me in the right direction.

When developing e-commerce solutions, different categories or product have different attributes or features. For instance, Computers category would have "RAM, ROM, Color, Processor Speed, etc" whereas Cars category would have "GearBox, Millage, FuelType, etc". Now check Dejavu Cars Index here, and note that all the car attributes are listed.

My question is, in a scenario where you have different catogories of product - cars, clothes, phone, groceries, etc, what is the best or practical way to handle that in respect to ReactiveSearch? Create mappings for each and every possible attribute?

divyanshu013 commented 6 years ago

I think one way to do this is have a field which contains all your attributes. For example, check the GitXplore app demo where all the repo topics reside in a single topics field and then I'm using a MultiDropdownList to display them.

You can also use the react prop to narrow down the attributes depending on which category is selected.

coommark commented 6 years ago

@divyanshu013 Thank you! I had just discovered that after posting the question. Yes that's one practical way to take care of it. I'm also reading up on Elasticsearch to find if it is discouraged to have each attribute created in the index and just have them as null where not applicable. (I'm new to ES, my experience is with Lucene.) That way I can only use the relevant filters on the specific category pages. I really want to be able to use it as Vehicle Type filters as per the E-commerce Demo. Not sure the topics sample above can be easily displayed as checkboxes.

Thank you a million for the response!

divyanshu013 commented 6 years ago

You're welcome. You can easily display the topics as checkboxes using MultiList instead of MultiDropdownList :)

coommark commented 6 years ago

Perfection! Let me start right away. This is the best!