<p>I'm building a site and getting some odd search results.</p>

<p>For example, searching against the term 'Gibraltar' returns an entry with four mentions of the term in it's content first, whilst an entry with 'Gibraltar' in the title and 10 instances in the body is returned second.</p>

<p>I am returning the results paginated, ie:</p>

<pre><code>{% paginate craft.entries.search( '*' ~ query ~ '*' ).limit(10).order('score') as entries %}
</code></pre>

<p>Any thoughts why this might be happening? I came across this issue reported last year at <a href="https://craftcms.stackexchange.com/questions/2376/search-order-score-criteria">Search order &quot;Score&quot; criteria</a> - seems to be the same issue.</p>

<p>Cole</p>

CC BY-SA 3.0
2015-11-16T15:52:17.630Z
Of the top of my head: shouldn't it be `.order('score DESC')`, because you want the highest score first?
Paul
CC BY-SA 3.0
2015-11-16T15:53:05.797Z
Hmm, according to the docs, it shouldn't :)
Paul
CC BY-SA 3.0
2015-11-17T13:04:04.053Z
Thanks @PaulVerheul - had tried that but throws an error
Cole Henley
<search>
Score order in search results
# Score order in search results

(Asked by: username_0 on 2015-11-16)

I'm building a site and getting some odd search results.
For example, searching against the term 'Gibraltar' returns an entry with four mentions of the term in it's content first, whilst an entry with 'Gibraltar' in the title and 10 instances in the body is returned second.
I am returning the results paginated, ie:
{% paginate craft.entries.search( '*' ~ query ~ '*' ).limit(10).order('score') as entries %}

Any thoughts why this might be happening? I came across this issue reported last year at Search order "Score" criteria - seems to be the same issue.
Cole

**Tags:** search
> **Comments:**
> **username_1**: Of the top of my head: shouldn't it be `.order('score DESC')`, because you want the highest score first?  
> **username_1**: Hmm, according to the docs, it shouldn't :)  
> **username_0**: Thanks @PaulVerheul - had tried that but throws an error  

---

## 0 answers

