<p>When Craft is determining a matching element’s score, it will loop through each of the search terms, and for each one, loop through each of the element’s attributes, and add the following points to the element’s score:</p>

<ul>
<li>If the attribute is an exact match of the search term, 100 points will be added</li>
<li>If the attribute contains a full-word match of the search term, 50 points will be added</li>
<li>If the attribute contains a partial match of the search term, 10 points will be added</li>
</ul>

<p>If the term is part of an “OR” group, then its points will be divided by the total number of terms within that group. So for example, if searching for “gin OR tonic” and an exact match is found within one of the custom fields, rather than getting 100 points, the element would only get 50.</p>

<p>As of today’s <a href="https://buildwithcraft.com/updates#build2582">2.2.2582 release</a>, if the attribute is the Title field, then the score will be multiplied by 5. For example, an exact match in the Title field would actually be 500 points, etc.</p>

CC BY-SA 3.0
2014-09-08T19:56:13.783Z
2014-09-08T19:56:13.783Z
Brandon Kelly
<p>Leading on from <a href="https://craftcms.stackexchange.com/questions/2045/modifying-search-scoring-algorithm">this question by Chris Lewis</a> </p>

<p>I can't seem to find anything on the technicals, but by what criteria "best-match to worst-match" calculated? For example, if I was to have, an entry with the title "Top Trees" then "Top Trees" I would expect to be a "best-match"?</p>

<p>This is a little bit "How do I get my post to the first page of the Craft Search!" I know.</p>

<search>
Search order "Score" criteria
# Search order "Score" criteria

(Asked by: username_0 on 2014-09-05)

Leading on from [this question by Chris Lewis](https://craftcms.stackexchange.com/questions/2045/modifying-search-scoring-algorithm)

I can't seem to find anything on the technicals, but by what criteria "best-match to worst-match" calculated? For example, if I was to have, an entry with the title "Top Trees" then "Top Trees" I would expect to be a "best-match"?

This is a little bit "How do I get my post to the first page of the Craft Search!" I know.

**Tags:** search


---

## 1 answers

### Answer by username_1 on 2014-09-08. Score: 10 | Accepted answer

When Craft is determining a matching element’s score, it will loop through each of the search terms, and for each one, loop through each of the element’s attributes, and add the following points to the element’s score:

* If the attribute is an exact match of the search term, 100 points will be added
* If the attribute contains a full-word match of the search term, 50 points will be added
* If the attribute contains a partial match of the search term, 10 points will be added

If the term is part of an “OR” group, then its points will be divided by the total number of terms within that group. So for example, if searching for “gin OR tonic” and an exact match is found within one of the custom fields, rather than getting 100 points, the element would only get 50.

As of today’s [2.2.2582 release](https://buildwithcraft.com/updates#build2582), if the attribute is the Title field, then the score will be multiplied by 5. For example, an exact match in the Title field would actually be 500 points, etc.


---

