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 James <lj...@163.com> on 2012/03/08 04:14:02 UTC

in solr how to support Document.SetBoost as lucene?

 Hi gurus,
In lucene, there is an API (Document.SetBoost) that can increase some specific doc's score. Is there some way we can do it in solr?
Thanks.



Re: in solr how to support Document.SetBoost as lucene?

Posted by Tommaso Teofili <to...@gmail.com>.
when indexing a Solr document by sending XML files via HTTP POST you can
set it adding the boost element to the doc one, see
http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_on_.22doc.22
If you plan to index using the java APIs (SolrJ, see
http://wiki.apache.org/solr/Solrj) you can do it with:
  SolrInputDocument doc = new SolrInputDocument();
  doc.setDocumentBoost(floatValue);

Hope this helps,
Tommaso

2012/3/8 James <lj...@163.com>

>  Hi gurus,
> In lucene, there is an API (Document.SetBoost) that can increase some
> specific doc's score. Is there some way we can do it in solr?
> Thanks.
>
>
>