1

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?

4
  • possible duplicate of Remove a content type from search results
    – rooby
    Commented Oct 25, 2014 at 4:31
  • Also you may want the rabbit_hole module to stop users viewing the actual node page at the node/NID URL.
    – rooby
    Commented Oct 25, 2014 at 4:32
  • @rooby I prefer global redirect for that, works more... globally ;)
    – Mołot
    Commented Oct 30, 2014 at 8:29
  • @molot: Sorry I didn't specifically mean the node/NID URL but the node page in general, because the OP says they don't want to show node pages to users because they exclusively use views for that (if I understood correctly).
    – rooby
    Commented Oct 30, 2014 at 23:07

2 Answers 2

0

You can achieve required customization by using Search configuration module.

additional things can be done with the modules are:

  1. Alter the appearance of the core node search form.
  2. Group content types for more meaningful searching
  3. Restrict search results by the content type. This is a role based restriction.
  4. Restrict search results from showing individual items.
  5. Alter the pager limit (aka number search item results per page).
0

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.

2
  • This is not necessary but is an option. You don't have to write code to do what the OP asks.
    – rooby
    Commented Oct 25, 2014 at 4:26
  • Added note that this answer suggestion is for the cases where keeping contrib module count low is preferred. It would be nice to have answer type taxonomy here, so "theres a module for that" and "diy" answers could be separated or even accepted as alternative.
    – user20301
    Commented Oct 27, 2014 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.