I've got a custom index set up that my site search is using. However, the indexer is indexing content AND media nodes. Although the search means that the media nodes won't show up, I'd quite like to not have them in the index, as the site is going to have a LOT of media nodes in it.
I've done that already (as I'm already excluding settings sections etc), but if someone adds a new media type to the system, they have to remember to update the index as well to exclude it. I was wondering if there was a blanket way to get it to just index content or media nodes. There's a setting on the index provider called "indexTypes" but I can't get that to work, and the documentation for it isn't that great.
Its not the end of the world as they won't add custom media types often, but it'd be nice to do if you know how?
Is your index set to index unpublished content? For indexes used for front end searches, I exclude unpublised stuff, that way, items in the recycle bin should be excluded, as they're unpublished when they get moved to the bin.
Yeah, it looks like it is! I always set it to false just to be on the safe side! :P one other thing to check, is the item in the recycle bin actually unpublished? I've had an issue in the past where there's somehow been items in the recycle bin that aren't unpublished!
Does any one have any suggestions on how to display only Content (filter) using Examine? (my code is below)
var searchString = Request["searchstring"];
if (!String.IsNullOrEmpty(searchString)) {
var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name;
var examine = ExamineManager.Instance.SearchProviderCollection[searchProvider];
examine.CreateSearchCriteria(IndexTypes.Content);
var searchResults = examine.Search(searchString, true);
}
Only Index Content Nodes in Examine
Hi,
I've got a custom index set up that my site search is using. However, the indexer is indexing content AND media nodes. Although the search means that the media nodes won't show up, I'd quite like to not have them in the index, as the site is going to have a LOT of media nodes in it.
Does anyone know a way of doing this?
Tim,
Aren't you in control of what is being indexed if you're creating a custom index? Add your media doc types to the list of node types to exclude
Or did I misunderstand the question?
Cheers,
/Dirk
Hi Dirk!
I've done that already (as I'm already excluding settings sections etc), but if someone adds a new media type to the system, they have to remember to update the index as well to exclude it. I was wondering if there was a blanket way to get it to just index content or media nodes. There's a setting on the index provider called "indexTypes" but I can't get that to work, and the documentation for it isn't that great.
Its not the end of the world as they won't add custom media types often, but it'd be nice to do if you know how?
hey guys... along the same lines... is there a way to exclude items that have been moved to the trash from the index?
thanks!
@Bob,
Is your index set to index unpublished content? For indexes used for front end searches, I exclude unpublised stuff, that way, items in the recycle bin should be excluded, as they're unpublished when they get moved to the bin.
@Tim, by default isn't supportUnpublished set to false?
Yeah, it looks like it is! I always set it to false just to be on the safe side! :P one other thing to check, is the item in the recycle bin actually unpublished? I've had an issue in the past where there's somehow been items in the recycle bin that aren't unpublished!
yeah, the site i am working on, it appears to be moslty related to media files in the recycle bin... i am indexing pdf files as well as content.
It seems that can be control using something like
ExamineManager.Instance.SearchProviderCollection["MySearcher"].CreateSearchCriteria(IndexTypes.Content);
where the key is CreateSearchCriteria(IndexTypes.Content)
although in my installation Umbraco 4.7.1.1 CreateSearchCriteria() only takes a string to define the type not an enum...
Hope this helps
Vlad
}
Does any one have any suggestions on how to display only Content (filter) using Examine? (my code is below)
is working on a reply...