Книга: Apache Solr Search Patterns
Назад: Faceting with hierarchical taxonomy
Дальше: Implementing semantic search

Faceting with size

The problem with faceting with size is that the ordering by size is not directly visible. Let us take the following sizes:

XS, S, M, L, XL, XXL

These sizes would be listed in the alphabetical order as follows:

M, L, S, XL, XS, XXL

To handle such ordering scenarios in size for different apparel, we could encode a size tag into the size facet label. Therefore, the size ordering would be somewhat as follows:

[00002]XS [00003]S [00004]M [00005]L [00006]XL [00007]XXL

This will ensure that the facets we get from Solr are ordered in the way we want them to be ordered.

Назад: Faceting with hierarchical taxonomy
Дальше: Implementing semantic search

Solr
Testing
dosare
121