A
A
Alex2014-10-31 12:45:26
Drupal
Alex, 2014-10-31 12:45:26

How to exclude content type from search in Drupal?

How to exclude the type of material from the search so that they are not even indexed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Elena, 2014-10-31
@Nidora

Solution:
1)Go to Configuration----->
2)Search and Metadata----->
3)Search Autocomplete settings----->
4)Search page - Node Tab (search/node/%)- ---->
5)Click customize----->
6)WHAT - What to display in Search Autocomplete suggestions?---->
7)Add all possible words (any word appearing on your website)--->
8)Click edit----->
9)In the field "Query performed to get suggestion *"----->
10)Replace the code with
"SELECT DISTINCT s.word FROM {search_index} s, {node} n WHERE n.type = 'tablefield' AND n.nid = s.sid AND n.status = 1 AND LOWER(s.word) LIKE LOWER(:like_word)"
where
---{search_index} is the site indexing table after running cron in phpmyadmin.
---{node} - table with nodes from the site.
---n - variable where the selection from MATERIAL TYPE= tableifield fits. ----> you need to select your column, i.e. YOUR TYPE OF MATERIAL that you want it to ONLY index on your site.
11) Save.
12) Clean up the search_index table in your database.
13) Run Cron or Indexing on your site
14) Check how it works

D
Drupby, 2014-10-31
@drupby

https://www.drupal.org/sandbox/mfdeveloper/2148405

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question