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 Ryan McKinley <ry...@squid-labs.com> on 2007/05/28 21:18:01 UTC

Multiple copyFields as field boost hack?

I have an app where I want dismax style automatic field boosting (for 
the title), but also want to expose lucene query syntax (phrase, range, etc)

The default search field for my schema is "fulltext".  I am copying all 
the relevant fields but want "Boston" in the title to be worth more then 
"Boston" in the contributor.

If I put:
  <copyField source="title" dest="fulltext" />
  <copyField source="title" dest="fulltext" />
  <copyField source="title" dest="fulltext" />

Does this essentially boost title^3 within the fulltext field?

Is there any other recommended way to do this?

thanks
ryan




Re: Multiple copyFields as field boost hack?

Posted by Yonik Seeley <yo...@apache.org>.
On 5/28/07, Ryan McKinley <ry...@squid-labs.com> wrote:
> I have an app where I want dismax style automatic field boosting (for
> the title), but also want to expose lucene query syntax (phrase, range, etc)
>
> The default search field for my schema is "fulltext".  I am copying all
> the relevant fields but want "Boston" in the title to be worth more then
> "Boston" in the contributor.
>
> If I put:
>   <copyField source="title" dest="fulltext" />
>   <copyField source="title" dest="fulltext" />
>   <copyField source="title" dest="fulltext" />
>
> Does this essentially boost title^3 within the fulltext field?

More or less... it boosts it, but not by 3.
Lucene's DefaultSimilarity uses sqrt(freq) for the tf scoring factor.

-Yonik