You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kevin Osborn <ko...@centraldesktop.com> on 2015/03/18 01:57:03 UTC

copy field from boolean to int

I was hoping to use DocValues, but one of my fields is a boolean, which is
not currently supported by DocValues. I can use a copyField to convert my
boolean to a string. Is there is anyway to use a copyField to convert from
a boolean to a tint?

Re: copy field from boolean to int

Posted by Kevin Osborn <ko...@centraldesktop.com>.
I already use this field elsewhere, so I don't want to change it's type. I
did implement a UpdateRequestProcessor to copy from a bool to an int. This
works, but even better would be to fix Solr so that I can use DocValues
with boolean. So, I am going to try to get that working as well.

On Tue, Mar 17, 2015 at 10:25 PM, William Bell <bi...@gmail.com> wrote:

> Can you reindex? Just use 1,0.
>
> On Tue, Mar 17, 2015 at 6:08 PM, Chris Hostetter <hossman_lucene@fucit.org
> >
> wrote:
>
> >
> > Can you open a jira to add docValues support for BoolField? ... i can't
> > think of any good reason not to directly support that in Solr for
> > BoolField ... seems like just an oversight that slipped through the
> > cracks.
> >
> >
> > For now, your best bet is probably to use an UpdateProcessor ... maybe 2
> > instances of RegexReplaceProcessorFactory to match "true" and "false" and
> > replace them with "0" and "1" ?
> >
> >
> > : Date: Tue, 17 Mar 2015 17:57:03 -0700
> > : From: Kevin Osborn <ko...@centraldesktop.com>
> > : Reply-To: solr-user@lucene.apache.org
> > : To: solr-user@lucene.apache.org
> > : Subject: copy field from boolean to int
> > :
> > : I was hoping to use DocValues, but one of my fields is a boolean, which
> > is
> > : not currently supported by DocValues. I can use a copyField to convert
> my
> > : boolean to a string. Is there is anyway to use a copyField to convert
> > from
> > : a boolean to a tint?
> >
> >
> > -Hoss
> > http://www.lucidworks.com/
> >
>
>
>
> --
> Bill Bell
> billnbell@gmail.com
> cell 720-256-8076
>

Re: copy field from boolean to int

Posted by William Bell <bi...@gmail.com>.
Can you reindex? Just use 1,0.

On Tue, Mar 17, 2015 at 6:08 PM, Chris Hostetter <ho...@fucit.org>
wrote:

>
> Can you open a jira to add docValues support for BoolField? ... i can't
> think of any good reason not to directly support that in Solr for
> BoolField ... seems like just an oversight that slipped through the
> cracks.
>
>
> For now, your best bet is probably to use an UpdateProcessor ... maybe 2
> instances of RegexReplaceProcessorFactory to match "true" and "false" and
> replace them with "0" and "1" ?
>
>
> : Date: Tue, 17 Mar 2015 17:57:03 -0700
> : From: Kevin Osborn <ko...@centraldesktop.com>
> : Reply-To: solr-user@lucene.apache.org
> : To: solr-user@lucene.apache.org
> : Subject: copy field from boolean to int
> :
> : I was hoping to use DocValues, but one of my fields is a boolean, which
> is
> : not currently supported by DocValues. I can use a copyField to convert my
> : boolean to a string. Is there is anyway to use a copyField to convert
> from
> : a boolean to a tint?
>
>
> -Hoss
> http://www.lucidworks.com/
>



-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: copy field from boolean to int

Posted by Chris Hostetter <ho...@fucit.org>.
Can you open a jira to add docValues support for BoolField? ... i can't 
think of any good reason not to directly support that in Solr for 
BoolField ... seems like just an oversight that slipped through the 
cracks.


For now, your best bet is probably to use an UpdateProcessor ... maybe 2 
instances of RegexReplaceProcessorFactory to match "true" and "false" and 
replace them with "0" and "1" ?


: Date: Tue, 17 Mar 2015 17:57:03 -0700
: From: Kevin Osborn <ko...@centraldesktop.com>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: copy field from boolean to int
: 
: I was hoping to use DocValues, but one of my fields is a boolean, which is
: not currently supported by DocValues. I can use a copyField to convert my
: boolean to a string. Is there is anyway to use a copyField to convert from
: a boolean to a tint?


-Hoss
http://www.lucidworks.com/