1 of 13

Search API Best PracticesOctober 18, 2014

By Greg Boggs

http://www.gregboggs.com

Tweet me at @gregory_boggs

2 of 13

User Experience »

Performance »

SEO Impact »

Search is hard. Facets can confuse users.

Search API is difficult to cache, and it can be slow.

Default configurations are bad practice.

Confusing Facets »

Unexpected Results »

Caching often fails »

The code is slow »

Duplicate content »

Nofollow pain »

3 of 13

User Experience

  • Keep facets simple and predictable
  • Index everything
  • Use checkboxes
  • Elevate the search box

Search is hard.

Doing it well is harder.

4 of 13

Improving Search Experience

  • Index all the text fields.

  • Display the teaser text that’s affecting the results

  • Don’t have too many facets.

  • Don’t use facets if people don’t already know them.

  • Elevate search box if it’s in the header.

  • Do display a count of results as facets are confusing. Or, don’t use facets, use filters!

Search API Best Practices — User Experience

Checkbox Facets

Drop Down Facets

5 of 13

Performance

Search doesn’t have to be slow.

6 of 13

Facet API can produce thousands of unique pages.

Web crawlers get lost.

Individual search pages are expensive to generate.

THE CHALLENGE

Search API Best Practices — Performance

It’s breadcrumbs. No Really.

7 of 13

Solution

  • Prevent spiders from loading the pages with robots.txt and block spiders that ignore robots.txt.
  • Varnish all the things.
  • PHP5 with OP cache and APCu.
  • Use Tomcat to serve Apache Solr

Result

  • CPU usage dropped from 100% to 5%
  • Average Page load time cut in half.

Next steps

  • Repair or replace Current Search

Search API Best Practices — Performance

8 of 13

Performance

  • Solr is faster for searching.
  • Elastic performance is not affected by indexing.

Features

Ease of Use

Search API Best Practices — Solr vs Elastic

9 of 13

Seo Impact

10 of 13

Search API Best Practices — SEO Impact

Duplicate Content and Nofollow are Bad

Duplicate Content

Facet pages produce an array of duplicate, low quality content.

  • Duplicate content is discouraged and possibility carries a penalty.
  • Indexing search results is not recommended.

The Difficulties with Nofollow

  • Nofollow is used for untrusted and paid links.
  • It “burns” pagerank.
  • It doesn’t keep bots from loading pages.

So, what’s the best practice?

  • Robots.txt disallow
  • noindex active facet pages and search results

Disallow: *search-results/field-*

or Disallow: *search-results*

11 of 13

Search API Best Practices — SEO Impact

Nofollow Recommendations

Does it make sense to use rel="nofollow" for internal links? Like, for example, to link to your login page? "So for internal links, links within your site, I would try to leave the nofollow off.” - Matt Cutts

What is a nofollow link?� “The nofollow keyword indicates that the link is not endorsed by the original author or publisher of the page, or that the link to the referenced document was included primarily because of a commercial relationship between people affiliated with the two pages.” - W3C��Does this mean “PageRank sculpting” (trying to change how PageRank flows within your site using e.g. nofollow) is a bad idea?

“I wouldn’t recommend it, because it isn’t the most effective way to utilize your PageRank.” - Matt Cutts

“NoFollow doesn’t preserve PageRank. It burns it. Bzzzzt” - Ian Lurie (on Search Engine Land)

12 of 13

What’s coming in Drupal 8

Json endpoint for REST Services

Apache Solr and Search API joining forces

Better index stats

Perhaps better defaults?

13 of 13

Thank you. Questions?

Greg Boggs, Drupal Developer

http://www.gregboggs.com �@gregory_boggs

greg.boggs@thenewgroup.com

www.thenewgroup.com