Exclude images from examine search
# help-with-umbraco
t
Hi I've been following the tutorials on YouTube to use the examine search. How can I stop images from appearing on my search results but the same time let documents show? Thank you
s
I guess you can check on the searchresult from te examine index what the content-type is (doing this by heart, so not sure if the property is called exactly like that).
j
There is a system field called
__IndexType
, which has the value
media
for media and
content
for content. How you filter will depend how you are searching as there are many ways to perform the same search.
m
if you are using the fluent api from examine then you specifiy
CreateQuery("content")
to limit to content only... (Content being synonymous to Documents)
The Searcher has a CreateQuery method, where you can choose to search content, media or members
https://docs.umbraco.com/umbraco-cms/reference/searching/examine/quick-start#creating-the-search-query AFAIK though behind the scenes the native lucene query generated from the fluent api ends up with the
__IndexType
set, as mentioned by @User
2 Views