It sounds like you might be able to get the mix you want with three different boosts:
1) High boost on title 2) Lower boost on description 3) Function query boost on inventory The high boost on title will help push products with matches in the title to the top. The function query boost on inventory will help move higher inventory to the top. You can also use the QueryElevationComponent to move specific docs to the top for specific queries but this might not be effective for your use case. There is also a patch (SOLR-4465) which is experimental at this point but is designed for people to move custom sort algorithms into Solr through custom collectors. This is an advanced approach and would take a strong understanding Lucene collectors. On Wed, Mar 27, 2013 at 9:02 PM, scallawa <dami...@altrec.com> wrote: > We are using solr for search on our ecommerce site that primarily sells > clothing. We index search terms based on a title field and description > field. > > We want to be able to sort by most relevant and what we have more inventory > (there is a field for that). We have done some coding outside of Solr to > try and achieve this but it causes the following problem. > > Let's take jeans and boots as an example. A customer might search on boots > and solr returns a bunch of boots and jeans. The jeans are included > because > the description might contain some data like pant legs fits easily over > boots. Now if we have more inventory in the particular jeans than the > boots > solr returned, the user will get back a list that shows mostly jeans at top > and then somewhere down the list boots will show up. > > There isn't a problem with the jeans showing up but the boots should > actually be displayed first with the ones having the most inventory then > the > jeans can be somewhere at the bottom of the list. > > I want to eliminate the hacks that have been done to try to incorporate > inventory, i.e. have solr return the results and not manipulate it in code. > > I hope I have explained the problem enough for you to get the gist of what > I > am trying to accomplish. > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Solr-sorting-and-relevance-tp4051918.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Joel Bernstein Professional Services LucidWorks