In this blog, we are going to discuss the data models of facets in brief. In this session, we will use JSON for understanding the Facets Data Modeling. Faceted search, like many other front-end UX patterns, needs an accurate and well-tailored facets data model. Fortunately, facets can be represented in a JSON record in several ways.
The majority of faceting is straightforward, requiring only a single word to define a product or service – an apple is a fruit, while Apple is a brand. To represent an “apple,” we can only utilize a single attribute:
{
"name": "apple",
"type": "fruit",
"seasonal_categories": ["fruits->late-summer", "fruits->autumn"]
}
or
{
"name": "iPhone 8 Gold Protection Screen",
"brand": "Apple",
"category": ["smartphone->protective-screens"]
}
The single-dimension attributes "type" and "brand" are facets. Facets, on the other hand, can be more complicated: they can be built up as hierarchies or nested attributes. We'll look at how different facet data models achieve distinct front-end features in this post, all of which are important for faceted search and guided navigation:
Become a Facets Certified professional by learning this HKR Facets Training!
We'll look at four different ways of defining facets and filters. Each has its set of objectives and benefits:
To begin, the most basic aspects are the most crucial. They use a minimum of terms to express the core of a thing. A shirt can be either long-sleeved or short-sleeved. There is only one average rating for a film. Simple facets, on the other hand, can have numerous values. T-shirts can be just one color or a combination of red and blue. A film may be described as a "romantic sci-fi comedy spoof." Simple and precise labeling helps your users find the greatest items, providing them precisely with what they're looking for. We discussed how facets may be used for both filterings and searching in our earlier post on faceted search.
Simple facets are simple to represent using JSON:
{
"name": "bold t-shirt",
"desc": “Be bold, wear a t-shirt with only one color”,
"color": “white”,
"sleeves": "short"
},
{
"name": "Hippie Vest with Fringes",
"desc": “Be hip: get back to where you belong, peace + love”,
"color": ["red", “orange”, “yellow”, “green”, "blue"],
"sleeves": "long"
}
Simple values:
{
"name": "Brad Pitt"
}
{
"first_name": "Brad",
"last_name": "Pitt"
}
{
"actors": [
{
"first_name": "Brad",
"last_name": "Pitt"
},
{
"first_name": "Scarlett",
"last_name": "Johanson"
}
]
}
{
"last_name": "King",
"first_name": "Stephen"
},
{
"last_name": "Shakespeare",
"first_name": "William"
}
Not only may more complicated layering be utilized for presentation, but it can also be used for filtering and search. Displaying itemized information about your items is one example. Let's look at two different use cases: one with simple attributes and the other with more complicated nesting. A firm that sells DVDs doesn't have to be very structured. They only need to ensure that the record has sufficient information for consumers to locate a film. Here's an example of a structure with simply two attributes:
{
"title": "Avengers: Infinity War",
"cast": ["Robert Downey Jr", "Chris Hemsworth", "Mark Ruffalo", "Chris Evans", "Scarlett Johansson"]
}
A website that gives extensive information on a film, such as IMDB or Netflix, on the other hand, must present more organized information:
{
"title": "Iron Man",
"cast": [
{
"first_name": "John",
"last_name": "Smith",
"birth_year": "1978",
"birth_place": "New York City, New York"
},
{
"first_name": "Robert",
"last_name": "Downey Jr",
"birth_year": "1965",
"birth_place": "New York City, New York"
}
]
}
The data for an onscreen information box is stored in this record. The only exception is that if your index has complicated nesting, you must tell the engine which portion of the structure it should look for. You'll need to make “cast.first_name” and “cast.last_name” searchable, as well as “cast.birth year” searching and filterable.
Top 30 frequently asked Facets Interview Question and Answers
Users may browse category and subcategory hierarchies in many-faceted search experiences, allowing them to limit or expand their search. Hierarchies can be used to construct category-based menu systems. While maintaining and designing extensive categories takes effort, when done correctly, hierarchies provide a fantastic faceted search and navigating experience. Take a look at how a supermarket can categorize its data to help people find the right online aisle:
[
{
"name": "lemon",
"categories.lvl0": "products",
"categories.lvl1": "products > fruits"
},
{
"name": "tomato",
"categories.level0": "products",
"categories.level1": "products > summer",
"categories.level2": "products > summer -> vegetables"
}
]
Booksellers do this as well, organizing each author into several categories, some with numerous hierarchies:
{
"name": "Ursula K. Le Guin",
"categories": [
"level0": "Books",
"level1": ["Books > Science Fiction", "Books > Literature & Fiction"],
"level2": ["Books > Science Fiction > Time Travel", "Books > Literature & Fiction > Literary"]
]
}
You and your firm do not have to handle all aspects. Users have their own opinions on how to classify and define your services and items. For instance, "Breaking Bad" may be classified as both a TV show and a crime drama. Users, on the other hand, will have different ideas. All user tags are grouped under the property "_tags" in this case:
{
"title": "Breaking Bad",
"_tags": ["drugs", “father figure”, “cancer”, “midlife crisis”, “violent”, “not for kids” ]
}
Users aren't the only ones that add facet tags. Machine learning algorithms and other kinds of artificial intelligence are increasingly combining user behavior, product descriptions, market data, and other factors to create useful ways to tag items. For instance, AI auto-tagging can enhance product classification by introducing surprising options as consumers search, click, and explore your catalog. You can learn about a product's age group, purpose, and other features that you hadn't considered before.
Image auto-tagging is a common example of this, in which image detection algorithms produce a collection of common tags for photos. This technique is used by websites like Pinterest, which provides gifs and pictures.
Consider how users purchase certain items every year during the holidays. The following might be produced via AI-generated tags.
{
"name": "Scotch tape",
"_tags": ["Christmas", “Halloween”, “New Years”]
}
This data may be used to market and manage your content, such as ensuring that “Scotch tape” appears prominently in search results during the holiday season.
In addition, you may use tags to create aspects in your data. We've looked at the tag and developed a new facet called "holiday_accessory":
{
"name": "Scotch tape",
"holiday_accessory": true
}
Facets are important for searching material, as we discussed in the previous article in our series on faceted search. Having facets that match user-inputted keywords significantly enhances your search. The engine doesn't care if it's searching a category, a basic facet, or a non-facet on a functional level. It looks in the direction that it is directed to gaze. As a result, it's critical to tell your engine to seek the precise attribute you're looking for.
With this in mind, we spoke about how a complicated nested structure may provide results that convey a story about a record item. Amazon's search results include more than just the price, image, product name, and description. Popularity, categories, Ratings, and shipping information are all included in the findings.
In the next post in our series on faceted search, we'll go over this in more detail.
Facets, both simple and sophisticated, offer a faceted search and navigational experience that is based on browsing — with or without the search. Facets can be shown in a variety of ways, including on the left side of the screen, front and center, like dropdowns, menus, and a variety of other inventive methods to allow users to browse with a single click.
However, facets enable your visitors to click, browse, and eventually find your whole online catalog of items and services, regardless of where they show on the screen or how you design them in your data. The technical aspect here is that the underlying JSON format must be well-tailored to meet the requirements of your front-end. This article aims to provide a strong basis for typical use cases across all industries and domains.
Conclusion
In this blog, we have covered all the concepts of the facets data model such as simple facets, nested facets, hierarchies in facets, tagging, and multi-purpose data modeling. We hope the readers have well understood the facets concepts.
Related Articles:
Batch starts on 24th Mar 2023, Fast Track batch
Batch starts on 28th Mar 2023, Weekday batch
Batch starts on 1st Apr 2023, Weekend batch