Hi Gustatec,
your problem seems a fairly basic relevance problem.
Instead of elevating documents, why don't you include the category as part
of the main query ?
To make it simple in Solr you have a query component which affect the score
and the filter queries which don't.

If in your case you add the category as part of the main query, documents
matching that category will be more relevant.
Relevancy is an hard topic, but based on your initial requirement I think
you can solve it quite easily.
If i misunderstood anything , let me know!

Cheers

On Fri, Nov 4, 2016 at 2:51 PM, Gustatec <gusta...@gmail.com> wrote:

> Hello everyone!
>
> I'm currently using Solr in a project (pretty much an e-commerce POC) and
> came across with the following sort situation:
>
> I have two products one called Product1 and other one called Product2, both
> of them belongs to the same categories, Shirt(ID 1) and Tank-Top(ID 2)
>
> When i query for any of these categories, it returns both of the products,
> in the same order.
>
> Is it possible to do some kind of grouping sort in query? So when i query
> for category Shirt, it returns first Product1 then Product2 and when i do
> the same query for category Tank-Top it would return first Product2 then
> Product1?
>
> By asking that i wonder if its possible to make a product more relevant,
> based on the query.
>
> So product1 relevancy would be
> Category ID | Priority
>     1       |     1
>     2       |     2
>
> And product2 would be
> Category ID | Priority
>     1       |     2
>     2       |     1
>
>
> Is it possible to achieve this "elevate" funcionality in query?
>
> i thought in doing a <category_name>_sort field  for all categories, but we
> are actually talking about a few hundred categories, so i dont know if
> would
> be viable to create one sort field for each one of them in every single
> doc...
>
> Ps: I asks if its achievable that in query because i dont know if there is
> any other way of changing the elevate.xml file without having to restart my
> solr instance
>
> Sorry for my bad english, and thanks in advance!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Different-Sorts-based-on-Different-Groups-tp4304516.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
--------------------------

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

Reply via email to