You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by rahulmodi <ra...@ge.com> on 2014/07/23 17:05:23 UTC

how to achieve static boost in solr

Hi,

I am struggling how to achieve static boost in solr, i have visited many web
sites but not getting solid answer.

The requirement is as below:
Suppose i have 100 keywords to search for and for each keyword i want
particular URL to be appear on top.

Say..
for keyword *"car"* the URL *"http://car.com"* should be on the top
for keyword *"building"* the URL *"http://building.com"* should be on the
top
for keyword *"java"* the URL *"http://javajee.com"* should be on the top
And So On....

How to achieve this if there are many no.of keywords or queries and i don't
want to Hard code in java API as i should not hard coding for hundreds of
keywords. 
I am using DB crawling and many of the keywords and all the urls are stored
in DB.
If i can use some configuration settings to achieve this then it will be
better.




--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-achieve-static-boost-in-solr-tp4148788.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to achieve static boost in solr

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi,

Can't you use elevateIds parameter?
https://wiki.apache.org/solr/QueryElevationComponent#elevateIds.2FexcludeIds



On Thursday, July 24, 2014 2:30 PM, rahulmodi <ra...@ge.com> wrote:
Thanks a lot Erick,

i have looked at Query Elevation Component, it works but the problem is if i
need to add new <query> tag or update existing <query> tag in elevate.xml
file then i need to restart the server in order to take effect.

I have also used "forceElevation=true" even then it requires restarting
server.

Is there any way by which we can achieve this without restarting server.

Also, there is another issue is that it works only when we use exact query,
example is below:
elevate.xml file has entry like:-

<query text="energy">
  <doc id="http://welcome.energy.com/" />
</query>

if i use "energy" as query then i get correct url as
"http://welcome.energy.com/"
But if i use "power energy" as query then i get another url but here also i
want the url "http://welcome.energy.com/" to be displayed.

Please suggest how to achieve this.
Thanks in advance.



--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-achieve-static-boost-in-solr-tp4148788p4148999.html



Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to achieve static boost in solr

Posted by Erick Erickson <er...@gmail.com>.
Yep, Query Elevation is a pretty blunt instrument. You should
be able to get the configuration file to re-load by issuing a reload
command rather than re-starting.

But your problem of having a bunch of different queries
return the same top doc is, indeed, the problem. You need
a complete list of query terms and each one needs an entry.

The only real alternative is to be able to somehow encode the
_reason_ these docs need to be returned first, which you
haven't articulated. If it's an arbitrary reason (i.e. "sponsored
search" or some such) it's pretty hard because there's no
rule to turn into an algorithm.

Best,
Erick


On Thu, Jul 24, 2014 at 4:30 AM, rahulmodi <ra...@ge.com> wrote:

> Thanks a lot Erick,
>
> i have looked at Query Elevation Component, it works but the problem is if
> i
> need to add new <query> tag or update existing <query> tag in elevate.xml
> file then i need to restart the server in order to take effect.
>
> I have also used "forceElevation=true" even then it requires restarting
> server.
>
> Is there any way by which we can achieve this without restarting server.
>
> Also, there is another issue is that it works only when we use exact query,
> example is below:
> elevate.xml file has entry like:-
>
> <query text="energy">
>   <doc id="http://welcome.energy.com/" />
> </query>
>
> if i use "energy" as query then i get correct url as
> "http://welcome.energy.com/"
> But if i use "power energy" as query then i get another url but here also i
> want the url "http://welcome.energy.com/" to be displayed.
>
> Please suggest how to achieve this.
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-achieve-static-boost-in-solr-tp4148788p4148999.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: how to achieve static boost in solr

Posted by rahulmodi <ra...@ge.com>.
Thanks a lot Erick,

i have looked at Query Elevation Component, it works but the problem is if i
need to add new <query> tag or update existing <query> tag in elevate.xml
file then i need to restart the server in order to take effect.

I have also used "forceElevation=true" even then it requires restarting
server.

Is there any way by which we can achieve this without restarting server.

Also, there is another issue is that it works only when we use exact query,
example is below:
elevate.xml file has entry like:-

<query text="energy">
  <doc id="http://welcome.energy.com/" />
</query>

if i use "energy" as query then i get correct url as
"http://welcome.energy.com/"
But if i use "power energy" as query then i get another url but here also i
want the url "http://welcome.energy.com/" to be displayed.

Please suggest how to achieve this.
Thanks in advance.



--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-achieve-static-boost-in-solr-tp4148788p4148999.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to achieve static boost in solr

Posted by Erick Erickson <er...@gmail.com>.
Take a look at Query Elevation Component perhaps?

Best,
Erick


On Wed, Jul 23, 2014 at 8:05 AM, rahulmodi <ra...@ge.com> wrote:

> Hi,
>
> I am struggling how to achieve static boost in solr, i have visited many
> web
> sites but not getting solid answer.
>
> The requirement is as below:
> Suppose i have 100 keywords to search for and for each keyword i want
> particular URL to be appear on top.
>
> Say..
> for keyword *"car"* the URL *"http://car.com"* should be on the top
> for keyword *"building"* the URL *"http://building.com"* should be on the
> top
> for keyword *"java"* the URL *"http://javajee.com"* should be on the top
> And So On....
>
> How to achieve this if there are many no.of keywords or queries and i don't
> want to Hard code in java API as i should not hard coding for hundreds of
> keywords.
> I am using DB crawling and many of the keywords and all the urls are stored
> in DB.
> If i can use some configuration settings to achieve this then it will be
> better.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-achieve-static-boost-in-solr-tp4148788.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>