I wan't aware of this so far...

In solrconfig.xml, if I want to set hl=on by default, <str
name="hl">on</str> or
<str name="hl">true</str> will result what I want. But if I set <bool
name="hl">on</bool>,
hl will be false. If set <bool name="hl">true</bool>, hl will be true.
When posting a search request, any one of hl=true|on|yes are all fine.

The reason is because the arguments in solrconfig.xml are parsed by
Boolean.valueOf() in DOMUtil:

:
} else if ("bool".equals(type)) {
val = Boolean.valueOf(getText(nd));
:

On the other hand, at the requesting time, HighlightComponent takes hl
parameter as string type
and parses by parseBool().

Should we accept not only <bool>true</bool>, but also <bool>on</bool>
and <bool>yes</bool>?
I think it is easy by using parseBool() instead of Boolean.valueOf() in
DOMUtil.

Thoughts?

Koji

Reply via email to