How to optimize your site's search results (Drupal with Faceted Search)

Created by Dennis Stevense, Modified on Mon, 09 Sep 2019 at 08:33 PM by Mac Clemmens

Note: while the guidelines in this article apply to most search systems, this article was written for Drupal with Faceted Search. If your site uses Drupal with Apache Solr, some of the specifics of this article may not apply.

About search ranking

When performing a search, two things happen: first posts are filtered for keyword matches, and then those matching posts are sorted or "ranked." Typically, search results are ranked such that the most relevant result is at the top. Since relevance is subjective, the search system will use some kind of heuristic algorithm to approximate relevance. These algorithms can range from very complex and proprietary (such as Google's algorithm) to very simple (such as ranking search results by the time the content was last edited).

In Drupal with Faceted Search, and many other common search systems, search results are roughly based on word frequencies, weighed by where the word appears. For example, if a post has a total of 100 words and the word "water" appears in the body three (3) times, then the word frequency of "water" in the post body would be 3 ÷ 100 = 0.03. If a word appears in the title of the post, it receives an extra multiplier, say 5x. For example, if the word "water" appears once in the title and three (3) times in the body of the post, then the total score for that word for that post would be (1 ÷ 100 × 5) + (3 ÷ 100) = 0.08.

Making a post show up higher in your site's search results

Knowing roughly how search results are ranked, you can adjust your content to make certain posts score higher for certain search keywords. Keep in mind that trying to tweak one set of search results may adversely affect another set of search results. For example, if you optimize a post for "water" you have to be careful it doesn't score so high that it competes with more relevant posts in related searches such as "water shortage."


  • Adding or moving a keyword to the title, subtitle, or headings within the body will increase that keyword's score for that post.
  • Splitting up a long post into several smaller posts may make each of those posts rank higher, because the word frequency of each word increases when you decrease the total number of words in a post.
  • Adding a keyword to the "additional search keywords" field underneath the body field (make sure advanced mode is turned on) will increase the keyword frequency and score without affecting the visible text of the post. You can even repeat the same keyword many times in this field to further increase the keyword score for the post.

Related Articles:

Are you looking to optimize your site's presence in search engine results? (E.g. Google)

See "The Art and Science of SEO" including a checklist of ways to improve your search ranking.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article