Reputation: 3689
I'm trying to insert a value into a boolean field in solr by passing it as a field in a doc, thus:
<add>
<doc>
<field name="WouldBuySameModelAgain">value-here</field>
</doc>
</add>
The field definition in schema.xml is:
<field name="WouldBuySameModelAgain" type="boolean" index="false" stored="true" required="false" />
I haven't been able to find any documentation on what value should be used where it says "value-here" in my example. I have tried true & false, True & False, TRUE & FALSE, 1 & 0 all to no avail - there are still no documents in my index with a value in the boolean field. All of my non-boolean fields with stored="true" are getting values.
All suggestions welcomed.
Upvotes: 10
Views: 10279
Reputation: 3689
The answer is "true" or "false", doesn't appear to be case sensitive. For example:
<field name="WouldBuySameModelAgain">true</field>
An error elsewhere in my app was putting an empty string in where I was expecting a value.
Upvotes: 11