Skip to content

Instantly share code, notes, and snippets.

@tbillington
Last active September 6, 2016 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbillington/4645093d130f8e205289201cddbb8e4a to your computer and use it in GitHub Desktop.
Save tbillington/4645093d130f8e205289201cddbb8e4a to your computer and use it in GitHub Desktop.
// Regular meta boost
$mb = new ElementMetaBoost("hobbies", array());
// Add
$mb = new AddMetaBoost(new ElementMetaBoost("hobbies", array()), 0.2); // Worth 0.2 (20%) of score
@jdeniz
Copy link

jdeniz commented Sep 6, 2016

Hi Trent, In the end, it should look like this, correct?

$r->setMetaBoosts([
   new FilterMetaBoost(
        FieldFilter::LessThanOrEqualTo( "field_1", $value_1 ), 1.2)
    ),
   ...,
   new FilterMetaBoost(
        FieldFilter::LessThanOrEqualTo( "field_n", $value_n ), 1.2)
    ),
    //Hobbies will be added soon
   new AddMetaBoost( 
      new ElementMetaBoost( "hobbies", $hobbies_arr ), .2
   )
]);

@tbillington
Copy link
Author

Looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment