I have a content type let's say content type 'A', I am using view to show some of the field on some page, Now the problem is that pages generated by the content type are just a junk because I am not showing it to uses , only i am showing it using view page/block. Problem: I don't want to show those junk page in Search result , Plz let me know how to do it?
You can achieve required customization by using Search configuration module.
additional things can be done with the modules are:
- Alter the appearance of the core node search form.
- Group content types for more meaningful searching
- Restrict search results by the content type. This is a role based restriction.
- Restrict search results from showing individual items.
- Alter the pager limit (aka number search item results per page).
If you are still using the search from core, you should switch to for example search_api.
That beeing sayed, if you wish to avoid installing another contrib module and are willing to implement the functionality as a part of custom module. You could set excluded node types (programmatically) and then use hook_query_alter to filter out those types from each search.