You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jigar Shah <ji...@gmail.com> on 2014/10/05 17:49:41 UTC

FacetsConfig usage

Hello,

"*NOTE*: this configuration is not saved into the index, but it's vital,
and up to the application to ensure, that at search time the provided
FacetsConfig matches what was used during indexing."

Above statement is bit confusing. "search is always point-in-time, indexing
is over-the-time".
Does above statement mean, FacetsConfig created from the start of indexing,
the same object (settings) should be used always in future searches, and
changes  (add/remove of dim, changes in dim ) in FacetsConfig mid of
indexing is not advisable ?


*Consider a scenario:*

I have 3 taxonomy facets (country (flat, mult-valued), city (flat,
mult-valued), company (flat, mult-valued)) configured in FacetsConfig
object and indexer is indexing it in taxonomy directory, and Taxonomy
based  faceted search is working on 3 facets.

Now with one new requirement one more dim has to be added say 'person'. and
make 'company' hierarchical, previously this was (flat, multi-valued).

If on the fly FacetsConfig is updated (same used by indexer and searcher),
will everything work correctly, is it safe to do such changes in
FacetsConfig over the time when you already have some days of index on old
FacetsConfig ?

Thanks,
Jigar Shah

Re: FacetsConfig usage

Posted by Shai Erera <se...@gmail.com>.
Hi

The FacetsConfig object is the one that you use to index facets, and at
search time it is consulted about the facets attributes (multi-valued,
hierarchical etc.). You can make changes to the FacetsConfig, as long as
they don't contradict the indexed data in a problematic manner.

Usually the facets configuration does not change, but I believe it will
work if you add new dimensions. Current in-flight searches won't
query/count those dimensions anyway, and new searches will find those
dimensions in recently indexed documents only. It is up to you to decide if
the old 1 million documents that don't contain the new Person facet are OK
to display together w/ the 10 new documents that do, but as long as you're
OK with that, application-wise, adding new dimensions should just work.

Contradicting changes are changes to the attributes of one dimension, e.g.
from hierarchical to flat. In that case, that that there are 1 million old
documents indexed w/ A/B/C hierarchy and 10 new documents w/ only A/B
doesn't matter to the FacetsConfig - all documents will be considered flat
in that case. Here I'm less sure about the effects of that on search (I
don't think we have a test for it), but I hope that you don't do that. It's
not advisable, just like any other schema changes to your fields while
there are already indexed documents.

Shai