Hello, sorry for the late, I was out of my home.
In response to Rick: I can't do that because: 1) each user should have multiple sort (for example user "A" can sort by date and then by category and then by name ...) . 2) the sort is not natural sort: user has a custom order for a field (for example sorting category field of user "A" could be category 10 at position 1, category 2 at position 2, category 9500 at position 3, category 40 at position 5 ...). In response to Susheel:have you done an example? Thanks for your response. Luca On Thursday, July 20, 2017 4:10 AM, Susheel Kumar <susheel2...@gmail.com> wrote: Let me try to put an example for custom sort. On Wed, Jul 19, 2017 at 6:34 AM, Rick Leir <rl...@leirtech.com> wrote: > Luca, > You can pass a sort parameter in the query. User A could sort=date%20desc > and user b could sort=foofield%20asc. > > Maybe query functions can also help with this. Cheers -- Rick > > On July 19, 2017 4:39:59 AM EDT, Luca Dall'Osto > <tenacious...@yahoo.it.INVALID> wrote: > >Hello,The problem of build an index is that each user has a custom > >source order and category order: are not static orders (for example > >user X could have category:5 as most important category but user Y > >could have category:9 as most important). > >Has anyone ever written a custom sort function in solr?Maybe a link of > >a tutorial or an example could be very helpful. Thanks > > > >Luca > > > >On Tuesday, July 18, 2017 4:18 PM, alessandro.benedetti > ><a.benede...@sease.io> wrote: > > > > > >"I have different "sort preferences", so I can't build a index and use > >for > >sorting.Maybe I have to sort by category then by source and by language > >or > >by source, then by category and by date" > > > >I would like to focus on this bit. > >It is ok to go for a custom function and sort at query time, but I am > >curious to explore why an index time solution should not be ok. > >You can have these distinct fields : > >source_priority > >language_priority > >category_priority > >ect > > > >This values can be assigned at the documents at indexing time ( using > >for > >example a custom update request processor). > >Then at query time you can easily sort on those values in a multi > >layered > >approach : > >sort:source_priority desc, category_priority desc > >Of course, if the priority for a source changes quite often or if it's > >user > >dependent, a query time solution would be preferred. > > > > > > > > > > > >----- > >--------------- > >Alessandro Benedetti > >Search Consultant, R&D Software Engineer, Director > >Sease Ltd. - www.sease.io > >-- > >View this message in context: > >http://lucene.472066.n3.nabble.com/Get-results-in- > multiple-orders-multiple-boosts-tp4346304p4346559.html > >Sent from the Solr - User mailing list archive at Nabble.com. > > > > > > > > -- > Sorry for being brief. Alternate email is rickleir at yahoo dot com