<p>As suggested in <a href="https://craftcms.stackexchange.com/questions/2198/excluding-fields-in-a-search">this stack post</a>, you could specify each field individually. I haven't done this with fields, but often do so with sections and entry types in global site searches. It is kind of annoying, but I'm not sure there is a way to do this using Craft's API.</p>

CC BY-SA 3.0
2015-11-09T17:22:56.763Z
2015-11-09T17:22:56.763Z
2017-04-13T12:51:00.253Z
kcolls
<p>I have a search form on a website to search through all the entries of the website and return the entries that match the search query.</p>

<p>But the search query is also used on asset fields within an entry. Which for the companies channel results in many entries found when you search on the word: logo.</p>

<p>I like to know if there is a way to search through all the fields of an entry, but without looking through the asset field type?</p>

<p>So for the companies example, I only want to find entries that match the word: logo. When that word is in the content text, and not in an asset name/title.</p>

<p>My code now is this, but it returns the asset fieldtype result as well:</p>

<pre><code>{% set entries = craft.entries({ section: 'not comments' }).search( query ).order('score') %}
</code></pre>

<entries><assets><search>
Entries search without using asset fields
# Entries search without using asset fields

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

I have a search form on a website to search through all the entries of the website and return the entries that match the search query.
But the search query is also used on asset fields within an entry. Which for the companies channel results in many entries found when you search on the word: logo.
I like to know if there is a way to search through all the fields of an entry, but without looking through the asset field type?
So for the companies example, I only want to find entries that match the word: logo. When that word is in the content text, and not in an asset name/title.
My code now is this, but it returns the asset fieldtype result as well:
{% set entries = craft.entries({ section: 'not comments' }).search( query ).order('score') %}

**Tags:** entries, assets, search

---

## 1 answers

### Answer by username_1 on 2015-11-09. Score: 1 | Accepted answer

As suggested in [this stack post](https://craftcms.stackexchange.com/questions/2198/excluding-fields-in-a-search), you could specify each field individually. I haven't done this with fields, but often do so with sections and entry types in global site searches. It is kind of annoying, but I'm not sure there is a way to do this using Craft's API.


---

