{"id":20471098,"url":"https://github.com/drupal-modules/entity_score","last_synced_at":"2026-04-21T04:04:40.646Z","repository":{"id":20788390,"uuid":"24073494","full_name":"drupal-modules/entity_score","owner":"drupal-modules","description":"Entity Score (Drupal module).","archived":false,"fork":false,"pushed_at":"2014-09-15T20:55:52.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T13:37:14.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drupal-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-15T20:53:34.000Z","updated_at":"2020-05-10T13:44:16.000Z","dependencies_parsed_at":"2022-09-03T11:42:13.818Z","dependency_job_id":null,"html_url":"https://github.com/drupal-modules/entity_score","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drupal-modules/entity_score","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-modules%2Fentity_score","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-modules%2Fentity_score/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-modules%2Fentity_score/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-modules%2Fentity_score/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupal-modules","download_url":"https://codeload.github.com/drupal-modules/entity_score/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-modules%2Fentity_score/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32076295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T14:14:57.120Z","updated_at":"2026-04-21T04:04:40.630Z","avatar_url":"https://github.com/drupal-modules.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"INSTALLATION\n============\n\nSimply download and enable the module, you may do it via:\n\n```\ndrush dl entity_score\ndrush en entity_score\n```\n\nCONFIGURATION\n=============\n\nPlease go to __/admin/config/entity_score/boosts__ and choose field used to store entity score. The field must be of type __Float__ and may be used across several entity/node types. Scores will be automatically updated when entities are created/saved.\n\n\nYOUR OWN BOOSTS\n===============\n\nIn order to create custom boosts you need to do two things:\n\n* Provide *hook_entity_score_entity_score_boosts_list* function which returns list of boosts you'd like to support (our boost will use *_calculate_my_builtin_fields_title_per_character* as the callback function which should return quantity which will then be multiplied by boost value provided by user. Look at the example for clarification.\n\n  Example:\n\n  ```\n  function mymodule_entity_score_entity_score_boosts_list() {\n\n    // Machine name of the boosts group.\n    'my_builtin_fields' =\u003e array(\n\n    // Title of the boosts group.\n    'title' =\u003e t('My built-in fields'),\n\n    // An array of boost declarations.\n    'boosts' =\u003e array(\n\n      // Machine name of boost declaration.\n      'title_per_character' =\u003e array(\n\n        // Type may be also ENTITY_SCORE_BOOST_TYPE_CALLBACK, so third\n        // parameter to boost callback function will be a reference to\n        // final score value.\n        'type' =\u003e ENTITY_SCORE_BOOST_TYPE_NORMAL,\n\n        // Title of the field that is used to compute boost.\n        'field_title' =\u003e t('Title'),\n\n        // Description of boost functionality.\n        'boost_title' =\u003e t('Per character'),\n\n        // Default value for boost, may be skipped for 0.\n        'default_value' =\u003e 0.05,\n\n        // Bundles may be defined also as e.g.,\n        // array('node' =\u003e array('advert', ...), ...)\n        'bundles' =\u003e array('node'),\n\n        // Callback function, e.g.,\n        // callback($entity, $entity_type, \u0026$score)\n        // Third parameter is required only for boost with type\n        // ENTITY_SCORE_BOOST_TYPE_CALLBACK\n        'function' =\u003e\n          '_calculate_my_builtin_fields_title_per_character',\n      ),\n      // ...\n    ),\n    // ...\n}\n  ```\n\n* Provide callback function declared in boost declaration ('function'). In our example it is _calculate_my_builtin_fields_title_per_character.\n\n  Example:\n\n  ```\n  function _calculate_my_builtin_fields_title_per_character($entity, $entity_type, \u0026$score) {\n    if (!isset($entity-\u003etitle)) {\n      // Entity doesn't contain title.\n      return 0;\n    }\n\n    return strlen($entity-\u003etitle);\n  }\n  ```\n\nThat's all. Your boost declaration is ready to be enabled.\n\nEXPORT TO FEATURES\n==================\n\nCurrently it's supported via strongarm, just export all *entity_score\\** values into your module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupal-modules%2Fentity_score","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupal-modules%2Fentity_score","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupal-modules%2Fentity_score/lists"}