The ExternalFileField is the tool for this.

It is a field type which reads an array of floating point values from
a file, one per document. You can boost on it. (I don't know if sort
works.) There is no direct documentation that I found. Here are some
hints.

http://www.lucidimagination.com/search/?q=ExternalFileField

http://lucene.apache.org/solr/api/org/apache/solr/schema/ExternalFileField.html


On Fri, Nov 6, 2009 at 9:44 PM, Bhavnik Gajjar
<bhavnik.gaj...@gatewaynintec.com> wrote:
> Thanks again,
>
> This solution requires me to re-index 2 millions documents again in Solr!!!
>
> I would prefer something which can be done in ad-hoc way on my existing 
> working/live application.
>
> Also, regarding the solution [q=hello +(source:source1^100 source:source2^0.1 
> ...)], I think if sorting is being done on some other field (rather, score 
> desc) then it will messup documents!
>
> Is there a way to use function query or so then?
>
> Regards,
> Bhavnik Gajjar
>
> ----- Original Message -----
> From: "Avlesh Singh" <avl...@gmail.com>
> To: <solr-user@lucene.apache.org>
> Sent: Friday, November 06, 2009 10:25 PM
> Subject: Re: Lowering ranking of certain documents while search in Solr
>
>
>> How about adding an extra sint field, say "source_boost". For your 199
>> sources the indexed value can be 0. For the "underprivileged" source it can
>> be -1. Adding "sort=source_boost desc,score desc" would do the needful.
>>
>> Works?
>>
>> Cheers
>> Avlesh
>>
>> On Fri, Nov 6, 2009 at 4:55 PM, Bhavnik Gajjar <
>> bhavnik.gaj...@gatewaynintec.com> wrote:
>>
>>> Thanks for your inputs,
>>>
>>> This solution works in general!!
>>>
>>> In my system, there are around 200 different sources and out of that only
>>> one source is needed with lower rank. Now, if I go with the solution you
>>> provided then I need 199 sources with individual boost and then one source
>>> with lower boost value. Now, I'm afraid that, this would cause performance
>>> issue in Solr. Is there any other solution to work with this then?
>>>
>>> Note: our massive application is already built with standard request
>>> handler (I can't use dismax at this stage!!)
>>>
>>> Seeking for positive reply!
>>>
>>> Thanks again,
>>> Bhavnik Gajjar
>>>
>>>
>>> ----- Original Message -----
>>> From: "Avlesh Singh" <avl...@gmail.com>
>>> To: <solr-user@lucene.apache.org>
>>> Sent: Thursday, November 05, 2009 12:00 PM
>>> Subject: Re: Lowering ranking of certain documents while search in Solr
>>>
>>>
>>> > The query "q=hello&start=0&rows=20&fl=Source&bq=(*:*
>>> -Source:Source2^10000)"
>>> > should work as expected. There can be two reasons for it not to work -
>>> >
>>> >   1. You might be using a StandardRequestHandler. Try Dismax.
>>> >   2. Your field "Source" might not be indexed.
>>> >
>>> > With the StandardRequestHandler, if your "sources" are known (and
>>> limited),
>>> > you can try this too -
>>> > q=hello +(source:source1^100 source:source2^0.1 ...)
>>> >
>>> > Cheers
>>> > Avlesh
>>> >
>>> > On Thu, Nov 5, 2009 at 11:42 AM, Bhavnik Gajjar <
>>> > bhavnik.gaj...@gatewaynintec.com> wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> I have tried with
>>> >> q=hello&start=0&rows=20&fl=Source&bq=(*:* -Source:Source2^10000)
>>> >>
>>> >> But it doesn't change any ordering of results
>>> >>
>>> >> Am I doing wrong? Please advise.
>>> >>
>>> >> Note: We are also using _val_ hook in Solr query to get recent documents
>>> on
>>> >> top of results. (_val_:"recip(rord(DateAdded),1,1000,1000)")
>>> >>
>>> >> It would be really good if you can give me an exact example of Solr
>>> query
>>> >> that meets my need
>>> >>
>>> >> Thanks,
>>> >> Bhavnik
>>> >>
>>> >> ----- Original Message -----
>>> >> From: "Avlesh Singh" <avl...@gmail.com>
>>> >> To: <solr-user@lucene.apache.org>
>>> >> Sent: Thursday, November 05, 2009 11:19 AM
>>> >> Subject: Re: Lowering ranking of certain documents while search in Solr
>>> >>
>>> >>
>>> >> > This is what I meant -
>>> >> >
>>> >>
>>> http://wiki.apache.org/solr/SolrRelevancyFAQ#How_do_I_give_a_very_low_boost_to_documents_that_match_my_query
>>> >> >
>>> >> > Cheers
>>> >> > Avlesh
>>> >> >
>>> >> > On Thu, Nov 5, 2009 at 11:13 AM, Bhavnik Gajjar <
>>> >> > bhavnik.gaj...@gatewaynintec.com> wrote:
>>> >> >
>>> >> >> Hi Avlesh,
>>> >> >>
>>> >> >> Thanks for your inputs.
>>> >> >>
>>> >> >> What exactly I mean is.
>>> >> >>
>>> >> >> Solr has two fields named, Text and Source. Search is performed in
>>> >> [Text]
>>> >> >> field. Now suppose 1000 results come for a search. By default, this
>>> >> search
>>> >> >> returns records according to boost factor specified in Solr query
>>> >> already.
>>> >> >> Result would look somewhat like..
>>> >> >> Documents with value in [Source] Solr field
>>> >> >> Source1
>>> >> >> Source2
>>> >> >> Source3
>>> >> >> Source1
>>> >> >> Source3
>>> >> >> Source2
>>> >> >> etc..
>>> >> >>
>>> >> >> But, what we want to achieve is.. this search should return documents
>>> >> which
>>> >> >> has value [Source2] in [Source] field should come with the lowest
>>> >> ranking
>>> >> >> like,
>>> >> >> Source1
>>> >> >> Source3
>>> >> >> Source1
>>> >> >> Source3
>>> >> >> Source2
>>> >> >> Source2
>>> >> >>
>>> >> >> The solution you gave actually affects boosting of [Text] solr field
>>> not
>>> >> >> [Source] field.
>>> >> >>
>>> >> >> Thanks,
>>> >> >> Bhavnik Gajjar
>>> >> >>
>>> >> >>
>>> >> >> ----- Original Message -----
>>> >> >> From: "Avlesh Singh" <avl...@gmail.com>
>>> >> >> To: <solr-user@lucene.apache.org>
>>> >> >> Sent: Thursday, November 05, 2009 10:19 AM
>>> >> >> Subject: Re: Lowering ranking of certain documents while search in
>>> Solr
>>> >> >>
>>> >> >>
>>> >> >> > Query terms can be "boosted" to alter rank of documents. Read more
>>> >> here -
>>> >> >> >
>>> >>
>>> http://wiki.apache.org/solr/SolrRelevancyCookbook#Boosting_Ranking_Terms
>>> >> >> >
>>> >> >> > Cheers
>>> >> >> > Avlesh
>>> >> >> >
>>> >> >> > On Thu, Nov 5, 2009 at 10:14 AM, Bhavnik Gajjar <
>>> >> >> > bhavnik.gaj...@gatewaynintec.com> wrote:
>>> >> >> >
>>> >> >> >> Hi,
>>> >> >> >>
>>> >> >> >> Suppose, there are some documents already stored in Solr. These
>>> >> >> >> documents/records belong to various sources like, source1, source2
>>> >> etc
>>> >> >> >> (stored in 'Source' Solr field). Now, when user searches for
>>> >> documents
>>> >> >> >> (simple text search) then, is there any possibilities in Solr so
>>> that
>>> >> >> >> results of certain sources (eg, Source2) always come with lower
>>> rank?
>>> >> >> (ie,
>>> >> >> >> such sources always come in trailing pages).
>>> >> >> >>
>>> >> >> >> I believe, there should be some way for this in functional query;
>>> but
>>> >> >> not
>>> >> >> >> sure!
>>> >> >> >>
>>> >> >> >> Any help on this is greately appreciated.
>>> >> >> >>
>>> >> >> >> Thanks in advance,
>>> >> >> >> Bhavnik Gajjar
>>> >> >> >>
>>> >> >> >>
>>> >> >> >> The contents of this eMail including the contents of attachment(s)
>>> >> are
>>> >> >> >> privileged and confidential material of Gateway NINtec Pvt. Ltd.
>>> >> (GNPL)
>>> >> >> and
>>> >> >> >> should not be disclosed to, used by or copied in any manner by
>>> anyone
>>> >> >> other
>>> >> >> >> than the intended addressee(s). If this eMail has been received by
>>> >> >> error,
>>> >> >> >> please advise the sender immediately and delete it from your
>>> system.
>>> >> The
>>> >> >> >> views expressed in this eMail message are those of the individual
>>> >> >> sender,
>>> >> >> >> except where the sender expressly, and with authority, states them
>>> to
>>> >> be
>>> >> >> the
>>> >> >> >> views of GNPL. Any unauthorized review, use, disclosure,
>>> >> dissemination,
>>> >> >> >> forwarding, printing or copying of this eMail or any action taken
>>> in
>>> >> >> >> reliance on this eMail is strictly prohibited and may be unlawful.
>>> >> This
>>> >> >> >> eMail may contain viruses. GNPL has taken every reasonable
>>> precaution
>>> >> to
>>> >> >> >> minimize this risk, but is not liable for any damage you may
>>> sustain
>>> >> as
>>> >> >> a
>>> >> >> >> result of any virus in this eMail. You should carry out your own
>>> >> virus
>>> >> >> >> checks before opening the eMail or attachment(s). GNPL is neither
>>> >> liable
>>> >> >> for
>>> >> >> >> the proper and complete transmission of the information contained
>>> in
>>> >> >> this
>>> >> >> >> communication nor for any delay in its receipt. GNPL reserves the
>>> >> right
>>> >> >> to
>>> >> >> >> monitor and review the content of all messages sent to or from
>>> this
>>> >> >> eMail
>>> >> >> >> address and may be stored on the GNPL eMail system. In case this
>>> >> eMail
>>> >> >> has
>>> >> >> >> reached you in error, and you  would no longer like to receive
>>> eMails
>>> >> >> from
>>> >> >> >> us, then please send an eMail to d...@gatewaynintec.com
>>> >> >> >>
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >> The contents of this eMail including the contents of attachment(s)
>>> are
>>> >> >> privileged and confidential material of Gateway NINtec Pvt. Ltd.
>>> (GNPL)
>>> >> and
>>> >> >> should not be disclosed to, used by or copied in any manner by anyone
>>> >> other
>>> >> >> than the intended addressee(s). If this eMail has been received by
>>> >> error,
>>> >> >> please advise the sender immediately and delete it from your system.
>>> The
>>> >> >> views expressed in this eMail message are those of the individual
>>> >> sender,
>>> >> >> except where the sender expressly, and with authority, states them to
>>> be
>>> >> the
>>> >> >> views of GNPL. Any unauthorized review, use, disclosure,
>>> dissemination,
>>> >> >> forwarding, printing or copying of this eMail or any action taken in
>>> >> >> reliance on this eMail is strictly prohibited and may be unlawful.
>>> This
>>> >> >> eMail may contain viruses. GNPL has taken every reasonable precaution
>>> to
>>> >> >> minimize this risk, but is not liable for any damage you may sustain
>>> as
>>> >> a
>>> >> >> result of any virus in this eMail. You should carry out your own
>>> virus
>>> >> >> checks before opening the eMail or attachment(s). GNPL is neither
>>> liable
>>> >> for
>>> >> >> the proper and complete transmission of the information contained in
>>> >> this
>>> >> >> communication nor for any delay in its receipt. GNPL reserves the
>>> right
>>> >> to
>>> >> >> monitor and review the content of all messages sent to or from this
>>> >> eMail
>>> >> >> address and may be stored on the GNPL eMail system. In case this
>>> eMail
>>> >> has
>>> >> >> reached you in error, and you  would no longer like to receive eMails
>>> >> from
>>> >> >> us, then please send an eMail to d...@gatewaynintec.com
>>> >> >>
>>> >> >
>>> >>
>>> >>
>>> >> The contents of this eMail including the contents of attachment(s) are
>>> >> privileged and confidential material of Gateway NINtec Pvt. Ltd. (GNPL)
>>> and
>>> >> should not be disclosed to, used by or copied in any manner by anyone
>>> other
>>> >> than the intended addressee(s). If this eMail has been received by
>>> error,
>>> >> please advise the sender immediately and delete it from your system. The
>>> >> views expressed in this eMail message are those of the individual
>>> sender,
>>> >> except where the sender expressly, and with authority, states them to be
>>> the
>>> >> views of GNPL. Any unauthorized review, use, disclosure, dissemination,
>>> >> forwarding, printing or copying of this eMail or any action taken in
>>> >> reliance on this eMail is strictly prohibited and may be unlawful. This
>>> >> eMail may contain viruses. GNPL has taken every reasonable precaution to
>>> >> minimize this risk, but is not liable for any damage you may sustain as
>>> a
>>> >> result of any virus in this eMail. You should carry out your own virus
>>> >> checks before opening the eMail or attachment(s). GNPL is neither liable
>>> for
>>> >> the proper and complete transmission of the information contained in
>>> this
>>> >> communication nor for any delay in its receipt. GNPL reserves the right
>>> to
>>> >> monitor and review the content of all messages sent to or from this
>>> eMail
>>> >> address and may be stored on the GNPL eMail system. In case this eMail
>>> has
>>> >> reached you in error, and you  would no longer like to receive eMails
>>> from
>>> >> us, then please send an eMail to d...@gatewaynintec.com
>>> >>
>>> >
>>>
>>>
>>> The contents of this eMail including the contents of attachment(s) are
>>> privileged and confidential material of Gateway NINtec Pvt. Ltd. (GNPL) and
>>> should not be disclosed to, used by or copied in any manner by anyone other
>>> than the intended addressee(s). If this eMail has been received by error,
>>> please advise the sender immediately and delete it from your system. The
>>> views expressed in this eMail message are those of the individual sender,
>>> except where the sender expressly, and with authority, states them to be the
>>> views of GNPL. Any unauthorized review, use, disclosure, dissemination,
>>> forwarding, printing or copying of this eMail or any action taken in
>>> reliance on this eMail is strictly prohibited and may be unlawful. This
>>> eMail may contain viruses. GNPL has taken every reasonable precaution to
>>> minimize this risk, but is not liable for any damage you may sustain as a
>>> result of any virus in this eMail. You should carry out your own virus
>>> checks before opening the eMail or attachment(s). GNPL is neither liable for
>>> the proper and complete transmission of the information contained in this
>>> communication nor for any delay in its receipt. GNPL reserves the right to
>>> monitor and review the content of all messages sent to or from this eMail
>>> address and may be stored on the GNPL eMail system. In case this eMail has
>>> reached you in error, and you  would no longer like to receive eMails from
>>> us, then please send an eMail to d...@gatewaynintec.com
>>>
>>
>
>
> The contents of this eMail including the contents of attachment(s) are 
> privileged and confidential material of Gateway NINtec Pvt. Ltd. (GNPL) and 
> should not be disclosed to, used by or copied in any manner by anyone other 
> than the intended addressee(s). If this eMail has been received by error, 
> please advise the sender immediately and delete it from your system. The 
> views expressed in this eMail message are those of the individual sender, 
> except where the sender expressly, and with authority, states them to be the 
> views of GNPL. Any unauthorized review, use, disclosure, dissemination, 
> forwarding, printing or copying of this eMail or any action taken in reliance 
> on this eMail is strictly prohibited and may be unlawful. This eMail may 
> contain viruses. GNPL has taken every reasonable precaution to minimize this 
> risk, but is not liable for any damage you may sustain as a result of any 
> virus in this eMail. You should carry out your own virus checks before 
> opening the eMail or attachment(s). GNPL is neither liable for the proper and 
> complete transmission of the information contained in this communication nor 
> for any delay in its receipt. GNPL reserves the right to monitor and review 
> the content of all messages sent to or from this eMail address and may be 
> stored on the GNPL eMail system. In case this eMail has reached you in error, 
> and you  would no longer like to receive eMails from us, then please send an 
> eMail to d...@gatewaynintec.com
>



-- 
Lance Norskog
goks...@gmail.com

Reply via email to