lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Rafalovitch <arafa...@gmail.com>
Subject Best practices on managing facets with Code and Name
Date Tue, 04 Sep 2012 23:58:27 GMT
Hello,

I have some fields that have codes during search and internal
management but also have user presentable names. Those fields are used
for facets and I have a problem figuring out the best way to index,
store, and present them.

The best example would be a country name. I store the selected
countries in URL, so want to say ...&countries=ag|bo|cd but want those
names to show up to user and be searchable for by SOLR as "Antigua and
Barbuda", "Bolivia (Plurinational State of)", and "Democratic Republic
of the Congo". The additional challenge is that ideally I want those
full names in several languages (localized).

Currently I am storing country codes in a facetable field and store
country names in a catch-all names multiValue field. I get the codes
as facets with counts and then do lookups to match to original names.
But that does mean I have to look it up during indexing and then,
second time, during display. It is ok, but I feel there must be a
better way.

I also tried conflating the fields into one, e.g. "ag Antigua and
Barbuda" which would give both names when I retrieve facets, but
having to remember that the field is combined one is annoying and
error prone.

Similarly, I thought of requesting both codes and names as facets, but
that probably has a performance impact of double counting.

Any ideas or known best practices? This feels like a fairly common scenario.

Thank you,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)

Mime
View raw message