Solr customizing with Websphere Commerce - solr

I have a strange requirement in Solr.
The business model is like for each store in state (say victoria), we have different sales catalog (like Richmond, Brunswick etc) which in turn act as fulfillment centers on their own.
so my url of storeId- vic and catalogId-Richmond will retrieve me catalogues with richmond's store.
Now the requirement is I need to filter out the products based on the inventory for each of these sales catalogues.
I constructed a TI table which has the following structure
catentry_id -------- QUANTITY_RICFUL-------------QUANTITY_BrunFUL
1234-------------------0------------------------------------20
I had incorporate the changes in solr query to add these columns in the final result too.
But I do not know how to filter out the products in the front end during catalogue navigation or during search.
Any help would be much appreciated!!!

So basically you want to tie the returned catalog entries in a list with inventory? For instance, when they click on a category you do not want to display products with no inventory?
This would be a customization you can either do at the Solr Level or at the JSP level. You should probably track inventory in commerce (import it) into a field Solr can key off of and then only return items with the flag set to greater than zero. I am not sure if you need actual inventory or just a boolean. Are you using a single fulfillment center or multiple ones? Multiple gets a bit trickier and it would require them to log in most likely but then fulfillment would be addressed by the ship to address.
If the store is set up with ATP inventory then you should just get this for free, as products not in stock will simply not be displayed. Check out this page in the infocenter - http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=%2Fcom.ibm.commerce.user.doc%2Fconcepts%2Fcosatpatpandnonatp.htm

I am not sure what you are trying to ask here but it seems you are trying to display a Quantity dropdown or display an Quantity field under each product on a search page which to me makes no sense from a UI perspective. Also keep in mind if you have integrated with a 3rd party inventory model that runs every few mins/hours etc. How often do you plan to run indexing etc?
I would rather leave such complexity to a Prodcut Detail page. If you do require to show an Quantity field on the search page I would rather prefer displaying a QuickView popup/modal that displays the color/size attributes with the quantity dropdown etc and enable a user to add an item to his/her shopping cart.

Related

Solr: ordering by a multi valued field

I need to create a new collection on my Solr 6.1.0 cluster where every row is a content and every content can belong to one or many categories, which are specified in a multivalued field categories.
In my web app the user can search by categories, and if wanted it can even group results by category. If it wants to order by category, what about the contents which belong to more than one category?
In this case, the search results page should show the same content more times in different categories. I don't want the web application to filter and order results because in this case, it should ask Solr for every row (I know this is not advised for bad performance), so is there a way to let Solr make this? For example, repeating the same content in two categories if a flag is enabled or if I am asking Solr to sort by category?
Until now I bypassed the problem cloning one record for every category and specifying the category ID in a single int field. But this is not optimized, because in this case my index is much bigger than it could be, and every content metadata a part of category is just the same for every content, and because of this I would like to have 1 content = 1 Solr record.

Multiple datasources for one model in CakePHP

I have a very interesting problem in relation to CakePHP. I have a client that is currently selling products on eBay, and wants to start selling products on their own website as well. There would, then, be two separate sales avenues: (1) eBay, and (2) website.
However, they do want to have a seamless website experience for their customers. Basically, they want their current eBay sites to be categories within their current website, and their current eBay auction items to be searchable on their website.
A simple CakePHP website would have two tables: products and categories, with the simple table relation of "products belongsTo categories" and "categories hasMany products". How would I then add in the eBay categories and products? Basically, I want the http://site/products/index to return a list of ALL products, both in the products table and on eBay. I want http://site/categories/index to return a list of all defined categories in the categories table plus the categories items are listed in on eBay.
eBay has a very good pretty much real-time request query API, so I've been thinking about an option to do this, but am wondering if there is a better way... I don't think this option would work very well with PaginatorComponent...
Method:
(1) In beforeFind, capture the request parameters and save to a persistent variable
(2) In afterFind, make a request to the eBay API based on the request parameters, then manually add the results to the $results array.
Again, I think this would work for basic find operations, but I'm not sure this would work with pagination because I'm not sure how to deal with, say, a 20 item page limit (i.e. How do I deal with a page 2 when only 18 items from the database were on page 1, and now on page 2 I need to start at 19 instead of 21 from the database?)
Is there a CakePHP syntax that I'm overlooking here, or do I just start working on coding for all of these eventualities?
I'm coding on a CakePHP 2.6.0 platform.
Thanks so much for your help!
One possible approach would be to read all the products from each datasource, sort them in memory and paginate from there. The number of products would of course play a major role here.
A second one, if the number of products does not change too often, would involve a background process to retrieve their ID, and the most essential data, from eBay and write them in the common Product table, flagging the rows created.
Then Paginator can then show your results, but other fast-changing data can be retrieved on-the-fly from eBay for the flagged products while composing the page.

Speeding up computation of product filters when performing search

I'am trying to find an efficient approach or algorithm to help me address the problem described below.
Let's say we have a database containing a very large collection of products. Each product has a large set of attributes, although these attributes could be shared among product. In additon, product are organized into multiple hierarchical categories.
An example: Home -> Kitchen -> dishwashers -> GE Electric Dishwasher Model blablabla.
I would like to present to a user browsing our products a list of possible filters he could use. To illustrate it think about Amazon product filters on the side of the page: If products have a "price" attribute, then they show a slider with the lower price and the highest price as extremities. If the attribute is "brand", they have a list of all the brand for all children of a selected category. Categories and attributes are two separate concepts in our design.
My problem is all computing these filters takes time because we have a very large collection of products with dozens of attributes. Is there a particular way to perform this filtering? I was thinking about computing all filters at each level before hand but since a user may apply the filter at a higher category and keep navigating down into more specific categories, the latter categories would need to be recomputed/updated anyway.
What we have tried: for each product in a selected category we compute the intersection of attributes and create filters based on it. results are not cached since filters propagate from parents to children categories when applied.
PS: the database I am using is SQL server 2012. Let me know if more information is needed to better answer/understand my question. Also if you think of more appropriate tags for this question, please feel free to update it.

Drupal 7, Ubercart, Product search by price range

I'm using Ubercart 3.x, Drupal7. Can anybody tell me how can I create a form for searching in products with price in specified interval? I.e. user should fill this form with minimum price in the interval and maximum price and after posting form he will see all suiting products.
I think you should be able to create a view to do exactly this. if you haven't already done so, install the views module. create a new view, filer by type of product, and add two exposed filers on the price field, one greater than and one less than.
When you publish your view, the user will see a form with two fields, and can search for products in the specified price range.
Hope this helps. If you haven't used views before, it's worth perusing the documentation first.
James

How to setup organization specific data elements about shared items?

First post, please be kind.
NOTE: I have reviewed entry #20856 (how to implement tagging) but feel this is different due to the fact that the tags method I'm considering is organization specific in my app. I’m hoping someone can confirm the direction I’m going or point out some other options.
(background) We are building a web application that gives different organizations visibility to their inventory in different locations. The database stores users, organizations, sites, and items and there are links from sites and items to organizations that allow us to determine which items / sites to show to which users (based on their organization).
It is common for two (or more) organizations to want to use the portal to check on the stock status of (for example) Widget A in the Los Angeles Warehouse. That part is fine. However, the different organizations also track unique information about Widget A. For example, Org 1 wants to track the color, volume, and primary vendor for each item. Org 2 wants to track Color, Stock Type, Inventory Cycle, Buyer Code for each item. I want to avoid a situation where I have to have a table loaded with all these possible fields and then figure out which organizations use which fields.
I’m considering using something along the lines of tags, but adding a tag category, and having the tag category be defined at the Org level. So, the basic table structure would be something like:
Table: OrgTagCategory
Fields: OrgId, TagCategoryId, CategoryTitle
Table: OrgTag
Fields: OrgId, TagCategoryId, TagId, TagTitle
Table: OrgItemTag
Fields: OrgId, ItemId, TagId
Then, when the user logged in the main dashboard the grid would include their appropriate item fields as columns in the grid. So, from above example, Org 1 would see Item#, Description (would be shown for all), color, volume, and primary vendor. Org 2 would be shown Item#, Description, Color, Stock Type, Inventory Cycle, Buyer Code.
Am I overthinking this or is there a simpler method of doing this that I’m missing? All thoughts / feedback sincerely appreciated.
That should be no problem, but you're storing the OrgId redundantly. Also it seems like there could be some overlap (probably a lot of overlap, realistically) between tags and orgs.
Here's how I'd do it:
Table: OrgTag
Fields: OrgId, TagId
Table: Tag
Fields: TagId, TagTitle
Table: ItemTag
Fields: ItemId, TagId
This way each org is associated with the tags it's interested in, but you don't have redundant tags. A given tag that's used by multiple orgs just gets a bunch of rows in OrgTag, instead of multiple rows in Tag with the same TagTitle.
You'd only need a table OrgTagCategory if there were multiple tag categories per org. But you haven't described this extra association as a requirement.
Based on your description I sketched a simplified model and combined it with the observation pattern. This should enable you to track various item properties and user preferences for viewing them. Admittedly, the Preference table may grow large, but data has to be stored somewhere anyway, and you may retrieve it using sql, which simplifies the business layer.
- Organization and person are types of users. User table has columns common to all users, while Organization and Person tables have columns specific to each one.
- A stock item (widget class) can be found at several sites (warehouses); a site stores many items.
- One item belongs to one user; a user can own many items.
- Measurement and trait are types of observations. Measurement is a numeric observation, like height. Trait is a descriptive observation, like color.
- An observation is of a specific type (height, weight, color), there can be many observations of the same type.
- One item (widget class) can have many observations, an observation relates to one item only.
- A user can prefer to display many observations; an observation may be preferred (to display) by many users.
UPDATE
We could simplify user's subscription to item details (observations) by tagging observation type, for example height, weight, width would be tagged with: all, dimensions, physical. Some other tags would be: accounting_interest, tracking_specific, etc. A user would then subscribe to tags only. Tags (could) form a hierarchy with ALL at the top.
- One observation type (height, weight, color) can have many tags, one tag belongs to many observation types.
- Each tag may have a parent tag forming a hierarchy.
- A user stores preferences for a set of tags that she usually monitors.
UPDATE 2
Now we can sort out who is who and who owns what. In this modification a user (now a person) can work for more than one organization (having several part-time jobs or contracts). An item belongs to a organization now. A logged-in user can see all items from all organization that she works for.
My first quick thot on this would be that - if this is just limited to 'showing' particular fields to particular Orgs on Dashboard then it is better to handle it on the App side. If there's any other usage of 'tagging' then pls clarify.
Here's a simple approach -
You can store a field [OrgDashboardFields] in the Org master table or the OrgItem table. This will be a comma (',') separated list of fields to be shown on the dashboard. At run-time fetch the [OrgDashboardFields] field and parse the comma separated list in the app and make the Dashboard Grid behave accordingly.
Or, if there's a dynamic-query framework then based on the [OrgDashboardFields] field you can create a dynamic SQL-query and get the desired result which is purely Org specific.

Resources