Hi Allistair,

On Wed, 2010-09-29 at 15:37 +0200, Allistair Crossley wrote:
> Hello list,
> 
> I am implementing a directory using Solr. The user is able to search with a 
> free-text query or 2 filters (provided as pick-lists) for country. A 
> directory entry only has one country.
> 
> I am using Solr facets for country and I use the facet counts generated 
> initially by a *:* search to generate my pick-list.
> 
> This is working fairly well but there are a couple of issues I am facing.
> 
> Specifically the countries pick-list does not contain ALL possible countries. 
> It only contains those that have been indexed against a document. 
> 
> I have looked at facet.missing but I cannot see how this will work - if no 
> documents have a country of Sweden, then how would Solr know to generate a 
> missing total of zero for Sweden - it's never heard of it.
> 
> I feel I am missing something - is there a way by which you tell Solr all 
> possible countries rather than relying on counts generated from the index? 
> 

I don't think you are missing anything. Instead, you've described it
very well: how should SOLR know of something that never made it into the
index?

Why not just state in the interface that for all missing countries (and
deduce that from the facets and the list retrieved from the database),
there are no hits. You can list those countries separately (or even add
them to the facets after processing solr's result).

If you do want to have them in the index, you'd have to add them by
adding empty documents. But you might get into trouble with required
fields etc. And you will change the statistics of the fields.


Chantal



Reply via email to