You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Koji Sekiguchi <ko...@r.email.ne.jp> on 2009/04/13 19:47:13 UTC

parsing bool type in solrconfig.xml

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


Re: parsing bool type in solrconfig.xml

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
Erik Hatcher wrote:
> +1 also.  on/yes/true should all work for boolean parameters (just 
> like Ant ;)
>
>     Erik
>
>
> On Apr 14, 2009, at 2:01 AM, Shalin Shekhar Mangar wrote:
>
>> 2009/4/13 Koji Sekiguchi <ko...@r.email.ne.jp>
>>
>>> 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.
>>>
>>
>> +1
>>
>> I know it is inconsistent but so are the request parameters like hl,
>> debugQuery etc which I doubt will be changed.
>>
>> -- 
>> Regards,
>> Shalin Shekhar Mangar.
>
>

Thanks guys. I opened https://issues.apache.org/jira/browse/SOLR-1115 .

Koji


Re: parsing bool type in solrconfig.xml

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
+1 also.  on/yes/true should all work for boolean parameters (just  
like Ant ;)

	Erik


On Apr 14, 2009, at 2:01 AM, Shalin Shekhar Mangar wrote:

> 2009/4/13 Koji Sekiguchi <ko...@r.email.ne.jp>
>
>> 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.
>>
>
> +1
>
> I know it is inconsistent but so are the request parameters like hl,
> debugQuery etc which I doubt will be changed.
>
> -- 
> Regards,
> Shalin Shekhar Mangar.


Re: parsing bool type in solrconfig.xml

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
2009/4/13 Koji Sekiguchi <ko...@r.email.ne.jp>

> 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.
>

+1

I know it is inconsistent but so are the request parameters like hl,
debugQuery etc which I doubt will be changed.

-- 
Regards,
Shalin Shekhar Mangar.