The other question is how often do prices change? Is it much more often than other product info (or per-user-and-product info)?
These are use cases for things like CurrencyField and ExternalFileField. The thing to know about these is that CurrencyField values are searchable, while ExternalFileField values are not. You may be able to make CurrencyField do what you need if you can express user-specific prices as a ratio of the standard price. It can look up the ratio by "currency code" (e.g. user ID), while storing the standard value using the "default currency" (e.g. a special user ID used for this purpose). Anyway, something to look at. -----Original Message----- From: Jack Krupansky [mailto:jack.krupan...@gmail.com] Sent: Wednesday, April 08, 2015 10:39 PM To: solr-user@lucene.apache.org; Brian Usrey Subject: Re: SOLR searching Are there at least a small number of categories of users with discrete prices, or can each user have their own price. The former is doable, the latter is not unless the number of users is relatively small, in which case they are equivalent to categories. You could have a set of dynamic fields, price_<user-id>, and fill in the user-id when doing the query. -- Jack Krupansky On Wed, Apr 8, 2015 at 5:21 PM, Brian Usrey <bigbriqua...@yahoo.com.invalid> wrote: > I am extremely new to SOLR and am wondering if it is possible to do > something like the following. Basically I have been tasked with > researching SOLR to see if we can replace our current searching algorithm. > We have a website with product data. Product data includes standard > things like Name, SKU, Description, StandardPrice and other things. I > can search that information with no issue, however in addition to the > product data, the Price of the product can depend on the user that is > logged in and doing the searching. So, for one user, the product > costs $2.50 and for another the same product costs $2.65. > Additionally a user might not have a price specifically for them, so > we would display the standard price of for the product which might be > $2.75. The tables in the database look similar to this: > ProductProductIDNameSKUDescriptionStandardPrice > > ProductUserPriceProductIDUserIDPrice > > How can I create the SOLR installation so that when searching for > products, I return the product information, including the correct > Price for the logged in user? We will know the UserID when searching, > so that can be part of the query. Also, part of the search might be > for all products in a certain price range ($.50 - $10.00) which should > take into account the price for the specific user. > I have started using the DataImporter and have come up with this > design:<document> > <entity name="product" > pk="productid" > query="select > productid as id > , ProductName > , ProductDescription > , StandardPrice > from product" > deltaImportQuery="" > deltaQuery="" > > > <field column="id" name="id"/> > <field column="ProductName" name="ProductName"/> > <field column="ProductDescription" name="ProductDescription"/> > <field column="StandardPrice" name="StandardPrice"/> > <entity child='true' name='CHILD' query="select ProductID as > id, UserID, Price from ProductUserPrice where productid = '${PARENT.id}'"> > <field column='id' /> > <field column='UserID' /> > <field column='Price' /> > </entity> > </entity> > </document> > > I can use this to import Parent information, but I have no idea how to > use the Child entity. I don't see how to handle nested docs in the > schema.xml. Is it possible to do so? > > I would appreciate any help, and if there is another way to solve this > beyond nested documents I am completely open to a different way. > > Thank You! > Brian > ************************************************************************* This e-mail may contain confidential or privileged information. If you are not the intended recipient, please notify the sender immediately and then delete it. TIAA-CREF *************************************************************************