<p>The reason that searching for <code>Ascot</code> doesn't match <code>sponsorenhochdreiascot</code> is because Craft doesn't do wildcard or fuzzy searching by default.</p>

<p>If you search for <code>*ascot</code> it would match.  You can all of the supported search syntaxes here: <a href="http://buildwithcraft.com/docs/searching" rel="nofollow">http://buildwithcraft.com/docs/searching</a></p>

<p><strong>Update:</strong>
As of <a href="https://craftcms.com/changelog#build2750" rel="nofollow">Craft 2.5</a>, you can enable <a href="https://craftcms.com/help/enabling-fuzzy-search-by-default" rel="nofollow">fuzzy</a> searching by default.</p>

CC BY-SA 3.0
2015-09-28T06:37:57.603Z
oahahh, damn. Sometimes one didnt see the simplest things. Thanks Brad!
phaetons
CC BY-SA 3.0
2015-09-27T19:25:14.070Z
2015-12-04T23:32:06.633Z
2015-12-04T23:32:06.633Z
Brad Bell
<p>We launched a website last week based on Craft CMS.
One page contains mainly a list with links to sponsors (entered in a rich text field). </p>

<p>I make a fulltext search (via <code>$critera-&gt;search</code>) through the whole website, that works very fine, but it just didn't find the link texts inside a rich text field. (e.g. "Ascot", <a href="http://www.unidram.de/en/festival/partner-sponsors" rel="nofollow noreferrer">http://www.unidram.de/en/festival/partner-sponsors</a>)</p>

<p>If I put the same text outside of the link, the search will find it. But that's not the solution, because the text should be the link.</p>

<p>I made a workaround and added Tags for every link to the page (except above given example). That did the job, but is additional work we won't normally do.</p>

<p>At first I clicked on "rebuild the search index". </p>

<p>The search on the website didn't find the page.
This is the template part of the search:</p>

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

<p>Then I searched for 'Ascot' in <code>craft_searchindex</code> in the DB. </p>

<p>Part of the content of the related field is this:</p>

<pre><code>performance netzuniversitaetsgesellschaft potsdam sponsorenhochdreiascot bristolmedienpartnerpotsdamer neueste nachrichten
</code></pre>

<p>While the content looks like this:</p>

<p><img src="https://i.sstatic.net/YAOAb.jpg" alt="content"></p>

<p>So in fact the word 'Ascot' is saved as part of 'sponsorenhochdreiascot'. 
As soon as I change it to 'sponsorenhochdrei ascot', the entry will be found by the search on the website.</p>

<p>The HTML Code of the part is:</p>

<pre><code>&lt;h3&gt;Sponsoren&lt;/h3&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.domainx.com/"&gt;HochDrei&lt;/a&gt;&lt;br&gt;
&lt;a target="_blank" href="http://www.domainy.de/"&gt;Ascot 
Bristol&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
</code></pre>

<p>The search index seems to miss some space characters.</p>

CC BY-SA 3.0
2015-09-25T22:17:08.500Z
Can you share the code you're using to search with? RTE fields get their data saved to `craft_searchindex` just like any other textual field. You can find the field ID for the field you're searching against and find the corresponding row in `craft_searchindex` to verify `ascot` is in the search data.
Brad Bell
CC BY-SA 3.0
2015-09-27T13:46:02.080Z
I made further tests. please sea the edited question, because comments just allow mini markdown formatting.
phaetons
<search><richtext>
Search through Linklist in Richtext field not working?
# Search through Linklist in Richtext field not working?

(Asked by: username_0 on 2015-09-25)

We launched a website last week based on Craft CMS.
One page contains mainly a list with links to sponsors (entered in a rich text field). 
I make a fulltext search (via $critera->search) through the whole website, that works very fine, but it just didn't find the link texts inside a rich text field. (e.g. "Ascot", http://www.unidram.de/en/festival/partner-sponsors)
If I put the same text outside of the link, the search will find it. But that's not the solution, because the text should be the link.
I made a workaround and added Tags for every link to the page (except above given example). That did the job, but is additional work we won't normally do.
At first I clicked on "rebuild the search index". 
The search on the website didn't find the page.
This is the template part of the search:
{% set query = craft.request.getPost('q') %}
{% set entries =  
 craft.entries.search(query).section('seitenstruktur').order('score') %}

Then I searched for 'Ascot' in craft_searchindex in the DB. 
Part of the content of the related field is this:
performance netzuniversitaetsgesellschaft potsdam sponsorenhochdreiascot bristolmedienpartnerpotsdamer neueste nachrichten

While the content looks like this:

So in fact the word 'Ascot' is saved as part of 'sponsorenhochdreiascot'. 
As soon as I change it to 'sponsorenhochdrei ascot', the entry will be found by the search on the website.
The HTML Code of the part is:
Sponsoren
HochDrei
Ascot 
Bristol


The search index seems to miss some space characters.

**Tags:** search, richtext
> **Comments:**
> **username_1**: Can you share the code you're using to search with? RTE fields get their data saved to `craft_searchindex` just like any other textual field. You can find the field ID for the field you're searching against and find the corresponding row in `craft_searchindex` to verify `ascot` is in the search data.  
> **username_0**: I made further tests. please sea the edited question, because comments just allow mini markdown formatting.  

---

## 1 answers

### Answer by username_1 on 2015-09-27. Score: 2

The reason that searching for `Ascot` doesn't match `sponsorenhochdreiascot` is because Craft doesn't do wildcard or fuzzy searching by default.

If you search for `*ascot` it would match. You can all of the supported search syntaxes here: <http://buildwithcraft.com/docs/searching>

**Update:**
As of [Craft 2.5](https://craftcms.com/changelog#build2750), you can enable [fuzzy](https://craftcms.com/help/enabling-fuzzy-search-by-default) searching by default.

> **Comments:**
> **username_0**: oahahh, damn. Sometimes one didnt see the simplest things. Thanks Brad!  

---

