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 Bürkle, David <da...@irix.ch> on 2011/07/28 12:26:25 UTC

Index time boosting with DIH

Can someone point me to an example for using index time boosting with the DataImportHandler.


RE: Index time boosting with DIH

Posted by Bürkle, David <da...@irix.ch>.
Thanks for the answer.
I want to share the configuration that worked for me (see the follow up question at the end):
(Boosting a document on the basis of a field value at index time.)

It took me some time to figure out, that for the row.get to work, I had to use the column name (the one in the select list) whereas for a put the fieldname (or pseudo fieldname) is working.

<dataConfig>
  <dataSource .../>
  <script><![CDATA[
    function BoostDoc(row) {
       if(row.get('SOME_COLUMN') == 'someValue') {
          row.put('$docBoost', 20);
       }  
       return row;
    } 
  ]]></script>               
  
  <document name="mydoc">
    <entity name="myentity" 
            transformer="script:BoostDoc"
            query="select ...">
     
     <field column="SOME_COLUMN" name="someField" /> 
     ...

A follow-up question:
This is only working for non-wildcard queries for me (StandardRequestHandler as well as edismax)
For wildcard-queries a constant score is returned.

Is there any way to get this setting working for wildcard queries as well?




-----Original Message-----
From: Shalin Shekhar Mangar [mailto:shalinmangar@gmail.com] 
Sent: Donnerstag, 28. Juli 2011 12:37
To: solr-user@lucene.apache.org
Subject: Re: Index time boosting with DIH

On Thu, Jul 28, 2011 at 3:56 PM, Bürkle, David <da...@irix.ch>wrote:

> Can someone point me to an example for using index time boosting with 
> the DataImportHandler.
>
>
You can use the special flag variable $docBoost to add a index time boost.

http://wiki.apache.org/solr/DataImportHandler#Special_Commands

--
Regards,
Shalin Shekhar Mangar.

Re: Index time boosting with DIH

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Jul 28, 2011 at 3:56 PM, Bürkle, David <da...@irix.ch>wrote:

> Can someone point me to an example for using index time boosting with the
> DataImportHandler.
>
>
You can use the special flag variable $docBoost to add a index time boost.

http://wiki.apache.org/solr/DataImportHandler#Special_Commands

-- 
Regards,
Shalin Shekhar Mangar.