lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Default value for dynamic fields
Date Thu, 03 Nov 2011 20:52:21 GMT
On Thu, Nov 3, 2011 at 12:59 PM, Milan Dobrota <milan@milandobrota.com> wrote:
> Is there any way to define the default value for the dynamic fields in
> SOLR? I use some dynamic fields of type float with _val_ and if they
> haven't been created at index time, the value defaults to 0. I would want
> this to be 1. Can that be changed?


On trunk, there are some new (currently undocumented) function queries
that can do this:
def(myfield,1)

If there are not normally 0 values anyway, you can also map any 0
values encountered via map(),
or min() if existing values are all positive.

-Yonik
http://www.lucidimagination.com

Mime
View raw message