What is Faceted Search: Definition, Use Cases, and Examples

by Tomas Laurinavicius, Partner

Faceted search, also known as faceted navigation or faceted browsing, is a search method that utilizes the metadata attributed to a product in a store.

It provides visitors with an opportunity to filter and refine their search queries when looking for specific products, making it a more flexible and efficient solution compared to simple filters.

Faceted search enhances the user experience, lowers site abandonment rates, and increases conversion rates, making it a must-have solution for most eCommerce sites.

Definition of Faceted Search

Faceted search is a type of information retrieval that combines lexical search with a faceted classification system.

It allows users to narrow down search results by applying filters based on the properties, or facets, of the items. Facets are derived from existing fields in a database or through analysis of the text using entity extraction techniques.

They correspond to the properties of the information elements and enable classifications to be accessed and ordered in multiple ways, rather than in a single predetermined taxonomic order.

Use Cases for Faceted Search

Faceted search is commonly used in various contexts, including:

  • E-commerce: Faceted search is widely used in online shopping to help customers narrow down their product options based on specific attributes. It can significantly reduce bounce rates and lead to higher conversion rates.
  • Content Management Systems: Faceted search can be used in content management systems to help users find the most relevant content by applying filters for attributes such as tags, categories, and authors.
  • Online Retail: Online retail catalogs were among the earliest applications of faceted search, reflecting the faceted nature of product data and the availability of data in existing information systems.
  • Enterprise Search: Faceted search has become a standard feature in modern enterprise search solutions, allowing users to filter search results by considering the peculiarity of values of important hit attributes.
  • Libraries: Faceted search is commonly used in online library catalogs to help users narrow down their search results by applying filters for attributes such as author, publication date, and subject.
  • Digital Asset Management: Faceted search can be used in digital asset management systems to help users find the most relevant digital assets by applying filters for attributes such as file type, author, and date.
  • Data Analysis: Faceted search can be used in data analysis tools to help users filter and analyze large datasets by applying filters for attributes such as time period, location, and category.
  • Customer Support: Faceted search can be used in customer support systems to help users find the most relevant help articles by applying filters for attributes such as product, version, and issue type.
  • Human Resources: Faceted search can be used in human resources systems to help users find the most relevant job openings by applying filters for attributes such as location, job type, and experience level.

Examples of Faceted Search

  • Amazon: Amazon uses faceted search to allow users to filter search results by multiple criteria such as price, brand, and category.
  • Google Shopping: Google Shopping also uses faceted search to help users narrow down their search results by applying filters for attributes such as price range, brand, and product category.
  • North Carolina State University Library Catalog: The NCSU library catalog uses faceted search to allow users to filter search results by various attributes such as author, publication date, format, and subject.

Benefits of Faceted Search

Faceted search provides several benefits, including:

  • Improves product findability: Faceted search removes the burden on users to select the precise keywords to enter into the search box.
  • Enhances the customer experience: Faceted search simplifies the customer's journey from search to purchase and sets accurate search result expectations.
  • Reduces null-results: Faceted search enables e-commerce stores to guide visitors in the right direction and avoid zero product availability situations.
  • Delivers valuable customer insights: Faceted search provides valuable customer insights by tracking user behavior and preferences.

Technology Used for Faceted Search

  • Elasticsearch is a popular solution for adding faceted search to eCommerce sites without doing too much manual work. JavaScript can also be used to sort and display large datasets on the website.
  • OpenSearch: A community-driven, open-source search and analytics suite that is a fork of Elasticsearch. It provides similar features and is fully compatible with existing Elasticsearch APIs.
  • Apache Solr: Built on Apache Lucene, Solr is a powerful open-source search platform that supports faceted search out of the box. It is known for its scalability and ability to handle large volumes of data.
  • Algolia: A cloud-based search service designed for speed and ease of use. Algolia provides real-time search capabilities and features like typo tolerance and geolocation-based filtering.
  • MeiliSearch: An open-source search engine focused on simplicity and speed, MeiliSearch supports typo tolerance and multi-language search, making it particularly well-suited for smaller datasets.
  • Typesense: An open-source search engine optimized for low latency and simplicity, Typesense provides features such as typo tolerance, filtering, and faceted search.
  • ZincSearch: A free alternative that serves as a drop-in replacement for Elasticsearch in certain contexts, ZincSearch supports full-text search and provides a simple setup process.
  • Pinecone: A managed vector database that excels in vector search capabilities. While it may not offer traditional faceted search features directly, it can be integrated into systems needing advanced similarity searches based on vector embeddings.
  • Weaviate: An AI-native vector database that supports both traditional keyword searches and advanced semantic searches. Weaviate is particularly useful for applications requiring vector similarity searches.

Best Practices for Implementing Faceted Search

Here are some best practices for setting up faceted search on your eCommerce site:

  • Use AJAX to avoid creating new URLs after a filter is applied and sorted.
  • Block crawlers from indexing specific pages using robots.txt.
  • Direct search engines toward pages you want crawled to avoid duplicate content issues using canonical tags.
  • Consult with a professional to assist with the technology required for eCommerce faceted search.

Conclusion

Faceted search is a powerful tool that can be effectively implemented in various contexts to enhance the user experience and improve conversion rates.

By allowing users to filter search results using multiple criteria, faceted search helps users find exactly what they're looking for and encourages them to make purchases.

Code Example: Implementing Faceted Search using Elasticsearch

Here is an example of how to implement faceted search using Elasticsearch in Python:

from elasticsearch import Elasticsearch

# Create an Elasticsearch client
es = Elasticsearch()

# Define the index and type
index = 'products'
type = 'product'

# Define the search query
query = {
    'query': {
        'match_all': {}
    },
    'facets': {
        'price': {
            'terms': {
                'field': 'price'
            }
        },
        'brand': {
            'terms': {
                'field': 'brand'
            }
        },
        'category': {
            'terms': {
                'field': 'category'
            }
        }
    }
}

# Execute the search query
response = es.search(index=index, type=type, body=query)

# Print the search results
print(response['hits']['hits'])

# Print the facets
print(response['facets'])

This code example demonstrates how to implement faceted search using Elasticsearch.

It defines a search query that includes facets for price, brand, and category, and then executes the search query using the Elasticsearch client.

The search results and facets are then printed to the console.

Code Example: Implementing Faceted Search using JavaScript

Here is an example of how to implement faceted search using JavaScript:

// Define the search data
const searchData = [
  {
    id: 1,
    name: 'Product 1',
    price: 10.99,
    brand: 'Brand A',
    category: 'Category A',
  },
  {
    id: 2,
    name: 'Product 2',
    price: 9.99,
    brand: 'Brand B',
    category: 'Category B',
  },
  {
    id: 3,
    name: 'Product 3',
    price: 12.99,
    brand: 'Brand A',
    category: 'Category A',
  },
]

// Define the facets
const facets = {
  price: [],
  brand: [],
  category: [],
}

// Populate the facets
searchData.forEach((product) => {
  if (!facets.price.includes(product.price)) {
    facets.price.push(product.price)
  }
  if (!facets.brand.includes(product.brand)) {
    facets.brand.push(product.brand)
  }
  if (!facets.category.includes(product.category)) {
    facets.category.push(product.category)
  }
})

// Define the search function
function search(query) {
  const results = []
  searchData.forEach((product) => {
    if (product.name.includes(query)) {
      results.push(product)
    }
  })
  return results
}

// Define the facet filter function
function filterByFacet(facet, value) {
  const results = []
  searchData.forEach((product) => {
    if (product[facet] === value) {
      results.push(product)
    }
  })
  return results
}

// Execute the search query
const query = 'Product'
const results = search(query)

// Print the search results
console.log(results)

// Print the facets
console.log(facets)

// Filter by facet
const facet = 'price'
const value = 10.99
const filteredResults = filterByFacet(facet, value)

// Print the filtered results
console.log(filteredResults)

This code example demonstrates how to implement faceted search using JavaScript.

It defines a search function that searches for products based on a query, and a facet filter function that filters products based on a facet and value.

The search results and facets are then printed to the console.

Keep exploring

10 Best UI Design Tools (Expert Picks for 2024)

Discover the top 10 UI design tools of 2024, including pricing, features, and user insights to elevate your design projects.

Read more

Best of 2023: Design and Dev Tools

A comprehensive list of the best design tools, dev tools, YouTube channels, apps, and creators of 2023, curated by Tomas Laurinavicius and Edgaras Benediktavicius.

Read more