For example, say I have the following facet:
Colors
- Red (7825)
- Orange (2343)
- Green (843)
- Blue (5412)
In my database, colors would be a table and each color would have a primary key and a name/value.
When indexing with Solr/Lucene, in all of the examples I've seen, the value is indexed and not the primary key. So if I filter by the color red, I would get something like the following:
http://www.example.com/search?color=Red
I'm wondering, is it wise to instead index the primary key and retrieve the values from the database when displaying the facet values? So I would instead get something like this:
http://www.example.com/search?color=1
"1" representing the primary key of the color red. I'm wondering if I should take this approach since the values of many of my facets frequently change, but the primary keys stay the same. Also, the index is required to be in sync with the database.
Does anymore have any experience with this? How do you think this will affect performance?
Thanks in advance!