I am nearly finished with my website on Drupal 8, and one last thing I have to do is optimize the search function. At this moment the search function only searches for node titles.

What I want to achieve is that the visitor can search by words and that the node will be shown as the search result. My website only has 7 seven pages at the moment, and will never grow beyond 10+ pages.

Example : I have a page about motorbikes( lets call the page motorbikes), in this page are some text blocks with motorbike brands like : yamaha and harley davidson and kawasaki. Now if the user is on the homepage and searches for kawasaki it should return the page motorbikes.

At this point the user would have to search for the page name, which in this case is motorbikes, to find the page.

So in short: I want to have a search function that searches the whole site for 1 or multiple words and then displays the page in which the words are found.

Can you guys help me on how to approach this problem, I don't need any code, just a little bit of guidance. Thanks in advance for any help !


You will need Search API and Search API Database for this - though I suggest setting up Apache Solr + Search API Solr instead of Search API Database.

and/or also:

Search API provides a lot more flexibility in terms of the types of search you want to configure and setup. Some functionality within say, Solr, allows for defining synonyms and abbreviations, as well as open you up to having facet based searches.

| improve this answer | |
  • Hi kevin, I forgot to mention that my website only has 7 pages, and will never grow to more then 10 pages. So isn't this overkill ? Or is this the only way to achieve what I want ? Also, do you have any written or video tutorials on how to use these features ? – Blomkfist174 Mar 7 '17 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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