<p>You can certainly achieve a very rudimentary form of plural search by following the recommendations in <a href="https://craftcms.stackexchange.com/a/20389/505">AbbeyDesign's answer</a>.</p>

<p>However, it comes with an important caveat: <strong>it won't work for plurals which do not include the singular form</strong>.</p>

<p>For example, baby / babies, knife / knives, or tooth / teeth.</p>

<p>If you need to accommodate this requirement, Craft's built-in search probably isn't going to cut it, and you'll need to go with something a bit more sophisticated.</p>

<p>I haven't personally tried it, but I think <a href="https://squarebit.co.uk/software/craft/searchplus" rel="nofollow noreferrer">Search Plus</a> can handle this. It's basically a convenient wrapper around <a href="https://www.algolia.com" rel="nofollow noreferrer">Algolia</a>, a very sophisticated search tool, which automatically handles pluralisation.</p>

CC BY-SA 3.0
2017-05-09T08:51:50.600Z
Ok thank you. I've added subRight. If I needed to handle doing it the other way around (searching 'apples' and returning 'apple') is there a more manual way of doing it such as adding tags to cover these variations? I assume if they don't output these tags on the front-end they wouldn't appear in results, I'd have to do a display:none.
sarah3585
CC BY-SA 3.0
2017-05-09T14:21:56.817Z
You could, in theory, create a "keywords" field, in which you explicitly list the singular and plural form of each desired search term, and tell Craft to search against that field (as described in [the documentation](https://craftcms.com/docs/searching)). However, this would require an enormous amount of patience, discipline, and indeed foresight on the part of the content author, and wouldn't scale at all.
Stephen Lewis
CC BY-SA 3.0
2017-05-08T16:13:11.997Z
2017-05-08T16:13:11.997Z
Stephen Lewis
<p>You'll want to enable fuzzy search as explained here in Craft Docs:</p>

<p><a href="https://craftcms.com/support/enabling-fuzzy-search-by-default" rel="nofollow noreferrer">Enable Fuzzy Search</a></p>

<p>But there's a little caveat you'll run into when you search for "apples" and expect to return "apple"</p>

<p><a href="https://craftcms.stackexchange.com/questions/15933/fuzzy-search-and-plurals">Fuzzy Search and Plurals</a></p>

CC BY-SA 3.0
2017-05-08T16:15:45.617Z
Important note: setting the `subRight` config to `true` will ensure that "apple" also matches "apples". Setting the `subLeft` config to `true` will result in "apple" also matching "grapple", which probably isn't what you want.
Stephen Lewis
CC BY-SA 3.0
2017-05-08T15:38:23.163Z
2017-05-08T15:38:23.163Z
AbbeyDesign
<p>Is it possible to include plural variations? For example if I search for 'apple' but the entry includes 'apples' it appears.</p>

<p>Or would this need to be approached by getting these variations into the entries via tags or similar?</p>

<pre><code>{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.search(query).order('score').section('newsEvents') %}


{% if entries|length %}
&lt;h3&gt;{{ entries|length }} result(s):&lt;/h3&gt;

    {% for entry in entries %}
         ...
    {% endfor %}

    {% else %}
     &lt;p&gt;Your search for "{{ query }}" didn't return any results.&lt;/p&gt;

{% endif %}             
</code></pre>

<search>
Search forms handling of plurals
# Search forms handling of plurals

(Asked by: username_0 on 2017-05-08)

Is it possible to include plural variations? For example if I search for 'apple' but the entry includes 'apples' it appears.
Or would this need to be approached by getting these variations into the entries via tags or similar?
{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.search(query).order('score').section('newsEvents') %}


{% if entries|length %}
{{ entries|length }} result(s):

    {% for entry in entries %}
         ...
    {% endfor %}

    {% else %}
     Your search for "{{ query }}" didn't return any results.

{% endif %}

**Tags:** search

---

## 2 answers

### Answer by username_1 on 2017-05-08. Score: 3 | Accepted answer

You can certainly achieve a very rudimentary form of plural search by following the recommendations in [AbbeyDesign's answer](https://craftcms.stackexchange.com/a/20389/505).

However, it comes with an important caveat: **it won't work for plurals which do not include the singular form**.

For example, baby / babies, knife / knives, or tooth / teeth.

If you need to accommodate this requirement, Craft's built-in search probably isn't going to cut it, and you'll need to go with something a bit more sophisticated.

I haven't personally tried it, but I think [Search Plus](https://squarebit.co.uk/software/craft/searchplus) can handle this. It's basically a convenient wrapper around [Algolia](https://www.algolia.com), a very sophisticated search tool, which automatically handles pluralisation.

> **Comments:**
> **username_0**: Ok thank you. I've added subRight. If I needed to handle doing it the other way around (searching 'apples' and returning 'apple') is there a more manual way of doing it such as adding tags to cover these variations? I assume if they don't output these tags on the front-end they wouldn't appear in results, I'd have to do a display:none.  
> **username_1**: You could, in theory, create a "keywords" field, in which you explicitly list the singular and plural form of each desired search term, and tell Craft to search against that field (as described in [the documentation](https://craftcms.com/docs/searching)). However, this would require an enormous amount of patience, discipline, and indeed foresight on the part of the content author, and wouldn't scale at all.  

---

### Answer by username_2 on 2017-05-08. Score: 2

You'll want to enable fuzzy search as explained here in Craft Docs:

[Enable Fuzzy Search](https://craftcms.com/support/enabling-fuzzy-search-by-default)

But there's a little caveat you'll run into when you search for "apples" and expect to return "apple"

[Fuzzy Search and Plurals](https://craftcms.stackexchange.com/questions/15933/fuzzy-search-and-plurals)

> **Comments:**
> **username_1**: Important note: setting the `subRight` config to `true` will ensure that "apple" also matches "apples". Setting the `subLeft` config to `true` will result in "apple" also matching "grapple", which probably isn't what you want.  

---

