On Tue, 2012-11-13 at 19:50 +0100, Yonik Seeley wrote:
> The original version of Solr (SOLAR when it was still inside CNET) did
> this - a multiValued field with a single value was output as a singe
> value, not an array containing a single value.  Some people wanted
> more predictability (always an array or never an array).

So there are two very different issues with this optimization:

Under the hood, it looks like a win. The single value field cache is
better performing (speed as well as memory) than the uninverted field.
There's some trickery with index updates as re-use of structures gets
interesting when all segments has been delivering single value and a
multi-value segment is introduced.

Dynamically changing response formats sounds horrible. The premise for
this optimization it laziness (or lack of oversight) from some users. If
the searcher normally returns one format, those users will design their
frontend from an expectation that it will _always_ return that format.

Always returning arrays, even when the underlying system has dynamically
selected single value mode and only a single value is returned, forces
the frontend programmers to consider both cases.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to