Re: How to show some documents ahead of others - requirements
I've seen a similar requirement to this recently. Basically, a sorting requirement that is close to impossible to implement as a scoring/boosting formula, because the *position* of the result features in the score, and that's not something I believe can be done right now. The way we solved the issue in the similar case I referred to above was by using a RerankQuery. That query class has a getTopDocsCollector() function, which you can override, providing your own Collector. If you then refer to your query(actually your query parser) with the rerank query param in Solr: rq={!myRerankQuery} then it will trigger your new collector, which will be given its topDocs() method is called, will call topDocs on its parent query, get a list of documents, then order them in some way such as you require, and return them in a non-score order. Not sure I've made that very clear, but hope it helps a little. Upayavira On Sat, Oct 10, 2015, at 03:13 PM, liviuchrist...@yahoo.com.INVALID wrote: > Hi Upayavira & Walter & everyone else > > About the requirements:1. I need to return no more than 3 paid results on > a page of 12 results2. Paid results should be sorted like this: let's say > a user is searching for: "chocolate almonds cake"Now, lets say that 2000 > results match the query and there are about 10 of these that are "paid > results".I need to list the first 3 (1-2-3) of the paid results (in their > ranking decreasing order) on the first page (maybe by improving the > ranking of the 20 paid results over the non-paid ones and listing the > first 3 of them.) and then listing 9 non-paid results on the page in > their ranking decreasing order. > Then, on the second page, I want to list first the next 3 paid results > (4-5-6) and so on. > > Kind regards,Christian > Christian Fotache Tel: 0728.297.207 > > From: Upayavira <u...@odoko.co.uk> > To: solr-user@lucene.apache.org > Sent: Thursday, October 8, 2015 7:03 PM > Subject: Re: How to show some documents ahead of others > > Hence the suggestion to group by the paid field - would give you two > lists of the number you ask for. > > What I'm trying to say is that the QueryElevationComponent might do it, > but it is also relatively clunky, so a pure search solution might do it. > > However, the thing we lack right now is a full take on the requirements, > e.g. how should paid results be sorted, how many paid results do you > show, etc, etc. Without these details we're all guessing. > > Upayavira > > > On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: > > Sorting all paid above all unpaid will give bad results when there are > > many matches. It will show 1000 paid items, include all the barely > > relevant ones, before it shows the first highly relevant unpaid recipe. > > What if that was the only correct result? > > > > Two approaches that work: > > > > 1. Boost paid items using the “boost” parameter in edismax. Adjust it to > > be a tiebreaker between documents with similar score. > > > > 2. Show two lists, one with the five most relevant paid, the next with > > the five most relevant unpaid. > > > > wunder > > Walter Underwood > > wun...@wunderwood.org > > http://observer.wunderwood.org/ (my blog) > > > > > > > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti > > > <benedetti.ale...@gmail.com> wrote: > > > > > > Is it possible to understand better this : "as it doesn't > > > allow any meaningful customization " ? > > > > > > Cheers > > > > > > On 8 October 2015 at 15:27, Andrea Roggerone > > > <andrearoggerone.o...@gmail.com > > >> wrote: > > > > > >> Hi guys, > > >> I don't think that sorting is a good solution in this case as it doesn't > > >> allow any meaningful customization.I believe that the advised > > >> QueryElevationComponent is one of the viable alternative. Another one > > >> would > > >> be to boost at query time a particular field, like for instance paid. > > >> That > > >> would allow you to assign different boosts to different values using a > > >> function. > > >> > > >> On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > > >> > > >>> Or just have a field in your index - > > >>> > > >>> paid: true/false > > >>> > > >>> Then sort=paid desc, score desc > > >>> > > >>> (you may need to sort paid asc, not sure which way a boolean would sort) > > &
Re: How to show some documents ahead of others - requirements
Would result grouping work here? If the group key was "paid", then you'd get two groups back, "paid" an "unpaid". Within each group you'd have results ordered by rank. This would work for a page or two, but eventually you'd be in a spot where you'd have to over sample, i.e. return pages*X in each group to be able to page very deeply. Or you could just fire two queries and have the app assemble the final list. Best, Erick On Sat, Oct 10, 2015 at 8:13 AM, Upayavira <u...@odoko.co.uk> wrote: > I've seen a similar requirement to this recently. > > Basically, a sorting requirement that is close to impossible to > implement as a scoring/boosting formula, because the *position* of the > result features in the score, and that's not something I believe can be > done right now. > > The way we solved the issue in the similar case I referred to above was > by using a RerankQuery. That query class has a getTopDocsCollector() > function, which you can override, providing your own Collector. > > If you then refer to your query(actually your query parser) with the > rerank query param in Solr: rq={!myRerankQuery} then it will trigger > your new collector, which will be given its topDocs() method is called, > will call topDocs on its parent query, get a list of documents, then > order them in some way such as you require, and return them in a > non-score order. > > Not sure I've made that very clear, but hope it helps a little. > > Upayavira > > On Sat, Oct 10, 2015, at 03:13 PM, liviuchrist...@yahoo.com.INVALID > wrote: >> Hi Upayavira & Walter & everyone else >> >> About the requirements:1. I need to return no more than 3 paid results on >> a page of 12 results2. Paid results should be sorted like this: let's say >> a user is searching for: "chocolate almonds cake"Now, lets say that 2000 >> results match the query and there are about 10 of these that are "paid >> results".I need to list the first 3 (1-2-3) of the paid results (in their >> ranking decreasing order) on the first page (maybe by improving the >> ranking of the 20 paid results over the non-paid ones and listing the >> first 3 of them.) and then listing 9 non-paid results on the page in >> their ranking decreasing order. >> Then, on the second page, I want to list first the next 3 paid results >> (4-5-6) and so on. >> >> Kind regards,Christian >> Christian Fotache Tel: 0728.297.207 >> >> From: Upayavira <u...@odoko.co.uk> >> To: solr-user@lucene.apache.org >> Sent: Thursday, October 8, 2015 7:03 PM >> Subject: Re: How to show some documents ahead of others >> >> Hence the suggestion to group by the paid field - would give you two >> lists of the number you ask for. >> >> What I'm trying to say is that the QueryElevationComponent might do it, >> but it is also relatively clunky, so a pure search solution might do it. >> >> However, the thing we lack right now is a full take on the requirements, >> e.g. how should paid results be sorted, how many paid results do you >> show, etc, etc. Without these details we're all guessing. >> >> Upayavira >> >> >> On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: >> > Sorting all paid above all unpaid will give bad results when there are >> > many matches. It will show 1000 paid items, include all the barely >> > relevant ones, before it shows the first highly relevant unpaid recipe. >> > What if that was the only correct result? >> > >> > Two approaches that work: >> > >> > 1. Boost paid items using the “boost” parameter in edismax. Adjust it to >> > be a tiebreaker between documents with similar score. >> > >> > 2. Show two lists, one with the five most relevant paid, the next with >> > the five most relevant unpaid. >> > >> > wunder >> > Walter Underwood >> > wun...@wunderwood.org >> > http://observer.wunderwood.org/ (my blog) >> > >> > >> > > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti >> > > <benedetti.ale...@gmail.com> wrote: >> > > >> > > Is it possible to understand better this : "as it doesn't >> > > allow any meaningful customization " ? >> > > >> > > Cheers >> > > >> > > On 8 October 2015 at 15:27, Andrea Roggerone >> > > <andrearoggerone.o...@gmail.com >> > >> wrote: >> > > >> > >> Hi guys, >> > >> I don't think that sorting is a good solution in this case as it doesn
Re: How to show some documents ahead of others - requirements
Hi Upayavira & Walter & everyone else About the requirements:1. I need to return no more than 3 paid results on a page of 12 results2. Paid results should be sorted like this: let's say a user is searching for: "chocolate almonds cake"Now, lets say that 2000 results match the query and there are about 10 of these that are "paid results".I need to list the first 3 (1-2-3) of the paid results (in their ranking decreasing order) on the first page (maybe by improving the ranking of the 20 paid results over the non-paid ones and listing the first 3 of them.) and then listing 9 non-paid results on the page in their ranking decreasing order. Then, on the second page, I want to list first the next 3 paid results (4-5-6) and so on. Kind regards,Christian Christian Fotache Tel: 0728.297.207 From: Upayavira <u...@odoko.co.uk> To: solr-user@lucene.apache.org Sent: Thursday, October 8, 2015 7:03 PM Subject: Re: How to show some documents ahead of others Hence the suggestion to group by the paid field - would give you two lists of the number you ask for. What I'm trying to say is that the QueryElevationComponent might do it, but it is also relatively clunky, so a pure search solution might do it. However, the thing we lack right now is a full take on the requirements, e.g. how should paid results be sorted, how many paid results do you show, etc, etc. Without these details we're all guessing. Upayavira On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: > Sorting all paid above all unpaid will give bad results when there are > many matches. It will show 1000 paid items, include all the barely > relevant ones, before it shows the first highly relevant unpaid recipe. > What if that was the only correct result? > > Two approaches that work: > > 1. Boost paid items using the “boost” parameter in edismax. Adjust it to > be a tiebreaker between documents with similar score. > > 2. Show two lists, one with the five most relevant paid, the next with > the five most relevant unpaid. > > wunder > Walter Underwood > wun...@wunderwood.org > http://observer.wunderwood.org/ (my blog) > > > > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti > > <benedetti.ale...@gmail.com> wrote: > > > > Is it possible to understand better this : "as it doesn't > > allow any meaningful customization " ? > > > > Cheers > > > > On 8 October 2015 at 15:27, Andrea Roggerone <andrearoggerone.o...@gmail.com > >> wrote: > > > >> Hi guys, > >> I don't think that sorting is a good solution in this case as it doesn't > >> allow any meaningful customization.I believe that the advised > >> QueryElevationComponent is one of the viable alternative. Another one would > >> be to boost at query time a particular field, like for instance paid. That > >> would allow you to assign different boosts to different values using a > >> function. > >> > >> On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > >> > >>> Or just have a field in your index - > >>> > >>> paid: true/false > >>> > >>> Then sort=paid desc, score desc > >>> > >>> (you may need to sort paid asc, not sure which way a boolean would sort) > >>> > >>> Question is whether you want to show ALL paid posts, or just a set of > >>> them. For the latter you could use result grouping on the paid field. > >>> > >>> Upayavira > >>> > >>> On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > >>>> Hi Christian, > >>>> > >>>> You can take a look at Solr's QueryElevationComponent > >>>> <https://wiki.apache.org/solr/QueryElevationComponent> . > >>>> > >>>> It will allow you to configure the top results for a given query > >>>> regardless > >>>> of the normal lucene scoring. Also you can specify exclude document > >> list > >>>> to > >>>> exclude certain results for perticular query. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> View this message in context: > >>>> > >>> > >> http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > >>>> Sent from the Solr - User mailing list archive at Nabble.com. > >>> > >> > > > > > > > > -- > > -- > > > > Benedetti Alessandro > > Visiting card - http://about.me/alessandro_benedetti > > Blog - http://alexbenedetti.blogspot.co.uk > > > > "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 >
Re: How to show some documents ahead of others - requirements
By far the easiest solution is to do two queries from the front end. One requesting three paid results, and one requesting nine unpaid results. If all the results are in one collection, use “fq” to select paid/unpaid. That is going to be fast and there is zero doubt that it will do the right thing. wunder Walter Underwood wun...@wunderwood.org http://observer.wunderwood.org/ (my blog) > On Oct 10, 2015, at 9:31 AM, Erick Erickson <erickerick...@gmail.com> wrote: > > Would result grouping work here? If the group key was "paid", then > you'd get two groups back, "paid" an "unpaid". Within each group you'd > have results ordered by rank. This would work for a page or two, but > eventually you'd be in a spot where you'd have to over sample, i.e. > return pages*X in each group to be able to page very deeply. > > Or you could just fire two queries and have the app assemble the final list. > > Best, > Erick > > On Sat, Oct 10, 2015 at 8:13 AM, Upayavira <u...@odoko.co.uk> wrote: >> I've seen a similar requirement to this recently. >> >> Basically, a sorting requirement that is close to impossible to >> implement as a scoring/boosting formula, because the *position* of the >> result features in the score, and that's not something I believe can be >> done right now. >> >> The way we solved the issue in the similar case I referred to above was >> by using a RerankQuery. That query class has a getTopDocsCollector() >> function, which you can override, providing your own Collector. >> >> If you then refer to your query(actually your query parser) with the >> rerank query param in Solr: rq={!myRerankQuery} then it will trigger >> your new collector, which will be given its topDocs() method is called, >> will call topDocs on its parent query, get a list of documents, then >> order them in some way such as you require, and return them in a >> non-score order. >> >> Not sure I've made that very clear, but hope it helps a little. >> >> Upayavira >> >> On Sat, Oct 10, 2015, at 03:13 PM, liviuchrist...@yahoo.com.INVALID >> wrote: >>> Hi Upayavira & Walter & everyone else >>> >>> About the requirements:1. I need to return no more than 3 paid results on >>> a page of 12 results2. Paid results should be sorted like this: let's say >>> a user is searching for: "chocolate almonds cake"Now, lets say that 2000 >>> results match the query and there are about 10 of these that are "paid >>> results".I need to list the first 3 (1-2-3) of the paid results (in their >>> ranking decreasing order) on the first page (maybe by improving the >>> ranking of the 20 paid results over the non-paid ones and listing the >>> first 3 of them.) and then listing 9 non-paid results on the page in >>> their ranking decreasing order. >>> Then, on the second page, I want to list first the next 3 paid results >>> (4-5-6) and so on. >>> >>> Kind regards,Christian >>> Christian Fotache Tel: 0728.297.207 >>> >>> From: Upayavira <u...@odoko.co.uk> >>> To: solr-user@lucene.apache.org >>> Sent: Thursday, October 8, 2015 7:03 PM >>> Subject: Re: How to show some documents ahead of others >>> >>> Hence the suggestion to group by the paid field - would give you two >>> lists of the number you ask for. >>> >>> What I'm trying to say is that the QueryElevationComponent might do it, >>> but it is also relatively clunky, so a pure search solution might do it. >>> >>> However, the thing we lack right now is a full take on the requirements, >>> e.g. how should paid results be sorted, how many paid results do you >>> show, etc, etc. Without these details we're all guessing. >>> >>> Upayavira >>> >>> >>> On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: >>>> Sorting all paid above all unpaid will give bad results when there are >>>> many matches. It will show 1000 paid items, include all the barely >>>> relevant ones, before it shows the first highly relevant unpaid recipe. >>>> What if that was the only correct result? >>>> >>>> Two approaches that work: >>>> >>>> 1. Boost paid items using the “boost” parameter in edismax. Adjust it to >>>> be a tiebreaker between documents with similar score. >>>> >>>> 2. Show two lists, one with the five most relevant paid, the next with >>>> the five most relevant unpaid. >
Re: How to show some documents ahead of others
Hi Christian, You can take a look at Solr's QueryElevationComponent <https://wiki.apache.org/solr/QueryElevationComponent> . It will allow you to configure the top results for a given query regardless of the normal lucene scoring. Also you can specify exclude document list to exclude certain results for perticular query. -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html Sent from the Solr - User mailing list archive at Nabble.com.
How to show some documents ahead of others
Hi everybody, I'm building a recipe search engine based on solr. Paid postings must be listed on the front page, ahead of non-paid postings. When a user performs a query based on some keywords, solr returns documents in the decreasing order of their score. However, I don't know how to make paid postings that match the query to be listed ahead of the un-paid postings that match the query. How to I give paid postings an extra scoring so that I can listed them on the first page? What other solutions would be? Please advice, Much obliged, Christian
Re: How to show some documents ahead of others
Or just have a field in your index - paid: true/false Then sort=paid desc, score desc (you may need to sort paid asc, not sure which way a boolean would sort) Question is whether you want to show ALL paid posts, or just a set of them. For the latter you could use result grouping on the paid field. Upayavira On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > Hi Christian, > > You can take a look at Solr's QueryElevationComponent > <https://wiki.apache.org/solr/QueryElevationComponent> . > > It will allow you to configure the top results for a given query > regardless > of the normal lucene scoring. Also you can specify exclude document list > to > exclude certain results for perticular query. > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to show some documents ahead of others
Hi guys, I don't think that sorting is a good solution in this case as it doesn't allow any meaningful customization.I believe that the advised QueryElevationComponent is one of the viable alternative. Another one would be to boost at query time a particular field, like for instance paid. That would allow you to assign different boosts to different values using a function. On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > Or just have a field in your index - > > paid: true/false > > Then sort=paid desc, score desc > > (you may need to sort paid asc, not sure which way a boolean would sort) > > Question is whether you want to show ALL paid posts, or just a set of > them. For the latter you could use result grouping on the paid field. > > Upayavira > > On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > > Hi Christian, > > > > You can take a look at Solr's QueryElevationComponent > > <https://wiki.apache.org/solr/QueryElevationComponent> . > > > > It will allow you to configure the top results for a given query > > regardless > > of the normal lucene scoring. Also you can specify exclude document list > > to > > exclude certain results for perticular query. > > > > > > > > > > > > -- > > View this message in context: > > > http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > > Sent from the Solr - User mailing list archive at Nabble.com. >
Re: How to show some documents ahead of others
Is it possible to understand better this : "as it doesn't allow any meaningful customization " ? Cheers On 8 October 2015 at 15:27, Andrea Roggerone <andrearoggerone.o...@gmail.com > wrote: > Hi guys, > I don't think that sorting is a good solution in this case as it doesn't > allow any meaningful customization.I believe that the advised > QueryElevationComponent is one of the viable alternative. Another one would > be to boost at query time a particular field, like for instance paid. That > would allow you to assign different boosts to different values using a > function. > > On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > > > Or just have a field in your index - > > > > paid: true/false > > > > Then sort=paid desc, score desc > > > > (you may need to sort paid asc, not sure which way a boolean would sort) > > > > Question is whether you want to show ALL paid posts, or just a set of > > them. For the latter you could use result grouping on the paid field. > > > > Upayavira > > > > On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > > > Hi Christian, > > > > > > You can take a look at Solr's QueryElevationComponent > > > <https://wiki.apache.org/solr/QueryElevationComponent> . > > > > > > It will allow you to configure the top results for a given query > > > regardless > > > of the normal lucene scoring. Also you can specify exclude document > list > > > to > > > exclude certain results for perticular query. > > > > > > > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > > > Sent from the Solr - User mailing list archive at Nabble.com. > > > -- -- Benedetti Alessandro Visiting card - http://about.me/alessandro_benedetti Blog - http://alexbenedetti.blogspot.co.uk "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
Re: How to show some documents ahead of others
Sorting all paid above all unpaid will give bad results when there are many matches. It will show 1000 paid items, include all the barely relevant ones, before it shows the first highly relevant unpaid recipe. What if that was the only correct result? Two approaches that work: 1. Boost paid items using the “boost” parameter in edismax. Adjust it to be a tiebreaker between documents with similar score. 2. Show two lists, one with the five most relevant paid, the next with the five most relevant unpaid. wunder Walter Underwood wun...@wunderwood.org http://observer.wunderwood.org/ (my blog) > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti <benedetti.ale...@gmail.com> > wrote: > > Is it possible to understand better this : "as it doesn't > allow any meaningful customization " ? > > Cheers > > On 8 October 2015 at 15:27, Andrea Roggerone <andrearoggerone.o...@gmail.com >> wrote: > >> Hi guys, >> I don't think that sorting is a good solution in this case as it doesn't >> allow any meaningful customization.I believe that the advised >> QueryElevationComponent is one of the viable alternative. Another one would >> be to boost at query time a particular field, like for instance paid. That >> would allow you to assign different boosts to different values using a >> function. >> >> On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: >> >>> Or just have a field in your index - >>> >>> paid: true/false >>> >>> Then sort=paid desc, score desc >>> >>> (you may need to sort paid asc, not sure which way a boolean would sort) >>> >>> Question is whether you want to show ALL paid posts, or just a set of >>> them. For the latter you could use result grouping on the paid field. >>> >>> Upayavira >>> >>> On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: >>>> Hi Christian, >>>> >>>> You can take a look at Solr's QueryElevationComponent >>>> <https://wiki.apache.org/solr/QueryElevationComponent> . >>>> >>>> It will allow you to configure the top results for a given query >>>> regardless >>>> of the normal lucene scoring. Also you can specify exclude document >> list >>>> to >>>> exclude certain results for perticular query. >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> >>> >> http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html >>>> Sent from the Solr - User mailing list archive at Nabble.com. >>> >> > > > > -- > -- > > Benedetti Alessandro > Visiting card - http://about.me/alessandro_benedetti > Blog - http://alexbenedetti.blogspot.co.uk > > "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
Re: How to show some documents ahead of others
Sure. Let's say that as Upayavira was saying you have in your index: "paid: true/false Then sort=paid desc, score desc" In that case, paid=true and higher score would come up first. After that you decide that you want to add a set of offers: Offer 1: cost 1000 euros Offer 2: cost 100 euros Offer 3: cost 10 euros and you expect that user1 (that pays more) appears before user 2 and 3. In such case the field true/false won't be enough as you don't have any way to sort user to have offer1 before offer2. Let's say for sake of conversation that you decide to replace "paid" with a numeric value paid=1 or 2 or 3. This solution would work better until you decide to improve relevancy...at that point your new solution wouldn't suit you anymore. So "as it doesn't allow any meaningful customization " meant that such solution is too rigid. Hope it makes sense. On Thu, Oct 8, 2015 at 3:39 PM, Alessandro Benedetti < benedetti.ale...@gmail.com> wrote: > Is it possible to understand better this : "as it doesn't > allow any meaningful customization " ? > > Cheers > > On 8 October 2015 at 15:27, Andrea Roggerone < > andrearoggerone.o...@gmail.com > > wrote: > > > Hi guys, > > I don't think that sorting is a good solution in this case as it doesn't > > allow any meaningful customization.I believe that the advised > > QueryElevationComponent is one of the viable alternative. Another one > would > > be to boost at query time a particular field, like for instance paid. > That > > would allow you to assign different boosts to different values using a > > function. > > > > On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > > > > > Or just have a field in your index - > > > > > > paid: true/false > > > > > > Then sort=paid desc, score desc > > > > > > (you may need to sort paid asc, not sure which way a boolean would > sort) > > > > > > Question is whether you want to show ALL paid posts, or just a set of > > > them. For the latter you could use result grouping on the paid field. > > > > > > Upayavira > > > > > > On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > > > > Hi Christian, > > > > > > > > You can take a look at Solr's QueryElevationComponent > > > > <https://wiki.apache.org/solr/QueryElevationComponent> . > > > > > > > > It will allow you to configure the top results for a given query > > > > regardless > > > > of the normal lucene scoring. Also you can specify exclude document > > list > > > > to > > > > exclude certain results for perticular query. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > View this message in context: > > > > > > > > > > http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > > > > Sent from the Solr - User mailing list archive at Nabble.com. > > > > > > > > > -- > -- > > Benedetti Alessandro > Visiting card - http://about.me/alessandro_benedetti > Blog - http://alexbenedetti.blogspot.co.uk > > "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 >
Re: How to show some documents ahead of others
Thanks Andrea, I agree with you. It seems much likely the classic " Relevancy biased by date" . But instead of having new docs we have paying docs. Probably a boost function can be helpful as already said. Cheers On 8 October 2015 at 17:03, Upayavira <u...@odoko.co.uk> wrote: > Hence the suggestion to group by the paid field - would give you two > lists of the number you ask for. > > What I'm trying to say is that the QueryElevationComponent might do it, > but it is also relatively clunky, so a pure search solution might do it. > > However, the thing we lack right now is a full take on the requirements, > e.g. how should paid results be sorted, how many paid results do you > show, etc, etc. Without these details we're all guessing. > > Upayavira > > > On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: > > Sorting all paid above all unpaid will give bad results when there are > > many matches. It will show 1000 paid items, include all the barely > > relevant ones, before it shows the first highly relevant unpaid recipe. > > What if that was the only correct result? > > > > Two approaches that work: > > > > 1. Boost paid items using the “boost” parameter in edismax. Adjust it to > > be a tiebreaker between documents with similar score. > > > > 2. Show two lists, one with the five most relevant paid, the next with > > the five most relevant unpaid. > > > > wunder > > Walter Underwood > > wun...@wunderwood.org > > http://observer.wunderwood.org/ (my blog) > > > > > > > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti < > benedetti.ale...@gmail.com> wrote: > > > > > > Is it possible to understand better this : "as it doesn't > > > allow any meaningful customization " ? > > > > > > Cheers > > > > > > On 8 October 2015 at 15:27, Andrea Roggerone < > andrearoggerone.o...@gmail.com > > >> wrote: > > > > > >> Hi guys, > > >> I don't think that sorting is a good solution in this case as it > doesn't > > >> allow any meaningful customization.I believe that the advised > > >> QueryElevationComponent is one of the viable alternative. Another one > would > > >> be to boost at query time a particular field, like for instance paid. > That > > >> would allow you to assign different boosts to different values using a > > >> function. > > >> > > >> On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > > >> > > >>> Or just have a field in your index - > > >>> > > >>> paid: true/false > > >>> > > >>> Then sort=paid desc, score desc > > >>> > > >>> (you may need to sort paid asc, not sure which way a boolean would > sort) > > >>> > > >>> Question is whether you want to show ALL paid posts, or just a set of > > >>> them. For the latter you could use result grouping on the paid field. > > >>> > > >>> Upayavira > > >>> > > >>> On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > > >>>> Hi Christian, > > >>>> > > >>>> You can take a look at Solr's QueryElevationComponent > > >>>> <https://wiki.apache.org/solr/QueryElevationComponent> . > > >>>> > > >>>> It will allow you to configure the top results for a given query > > >>>> regardless > > >>>> of the normal lucene scoring. Also you can specify exclude document > > >> list > > >>>> to > > >>>> exclude certain results for perticular query. > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> -- > > >>>> View this message in context: > > >>>> > > >>> > > >> > http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > > >>>> Sent from the Solr - User mailing list archive at Nabble.com. > > >>> > > >> > > > > > > > > > > > > -- > > > -- > > > > > > Benedetti Alessandro > > > Visiting card - http://about.me/alessandro_benedetti > > > Blog - http://alexbenedetti.blogspot.co.uk > > > > > > "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 > > > -- -- Benedetti Alessandro Visiting card - http://about.me/alessandro_benedetti Blog - http://alexbenedetti.blogspot.co.uk "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
Re: How to show some documents ahead of others
Hence the suggestion to group by the paid field - would give you two lists of the number you ask for. What I'm trying to say is that the QueryElevationComponent might do it, but it is also relatively clunky, so a pure search solution might do it. However, the thing we lack right now is a full take on the requirements, e.g. how should paid results be sorted, how many paid results do you show, etc, etc. Without these details we're all guessing. Upayavira On Thu, Oct 8, 2015, at 04:45 PM, Walter Underwood wrote: > Sorting all paid above all unpaid will give bad results when there are > many matches. It will show 1000 paid items, include all the barely > relevant ones, before it shows the first highly relevant unpaid recipe. > What if that was the only correct result? > > Two approaches that work: > > 1. Boost paid items using the “boost” parameter in edismax. Adjust it to > be a tiebreaker between documents with similar score. > > 2. Show two lists, one with the five most relevant paid, the next with > the five most relevant unpaid. > > wunder > Walter Underwood > wun...@wunderwood.org > http://observer.wunderwood.org/ (my blog) > > > > On Oct 8, 2015, at 7:39 AM, Alessandro Benedetti > > <benedetti.ale...@gmail.com> wrote: > > > > Is it possible to understand better this : "as it doesn't > > allow any meaningful customization " ? > > > > Cheers > > > > On 8 October 2015 at 15:27, Andrea Roggerone <andrearoggerone.o...@gmail.com > >> wrote: > > > >> Hi guys, > >> I don't think that sorting is a good solution in this case as it doesn't > >> allow any meaningful customization.I believe that the advised > >> QueryElevationComponent is one of the viable alternative. Another one would > >> be to boost at query time a particular field, like for instance paid. That > >> would allow you to assign different boosts to different values using a > >> function. > >> > >> On Thu, Oct 8, 2015 at 1:48 PM, Upayavira <u...@odoko.co.uk> wrote: > >> > >>> Or just have a field in your index - > >>> > >>> paid: true/false > >>> > >>> Then sort=paid desc, score desc > >>> > >>> (you may need to sort paid asc, not sure which way a boolean would sort) > >>> > >>> Question is whether you want to show ALL paid posts, or just a set of > >>> them. For the latter you could use result grouping on the paid field. > >>> > >>> Upayavira > >>> > >>> On Thu, Oct 8, 2015, at 01:34 PM, NutchDev wrote: > >>>> Hi Christian, > >>>> > >>>> You can take a look at Solr's QueryElevationComponent > >>>> <https://wiki.apache.org/solr/QueryElevationComponent> . > >>>> > >>>> It will allow you to configure the top results for a given query > >>>> regardless > >>>> of the normal lucene scoring. Also you can specify exclude document > >> list > >>>> to > >>>> exclude certain results for perticular query. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> View this message in context: > >>>> > >>> > >> http://lucene.472066.n3.nabble.com/How-to-show-some-documents-ahead-of-others-tp4233481p4233490.html > >>>> Sent from the Solr - User mailing list archive at Nabble.com. > >>> > >> > > > > > > > > -- > > -- > > > > Benedetti Alessandro > > Visiting card - http://about.me/alessandro_benedetti > > Blog - http://alexbenedetti.blogspot.co.uk > > > > "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 >