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 blargy <zm...@hotmail.com> on 2010/03/14 21:42:20 UTC

RegexTransformer

How would I go about splitting a column by a certain delimiter AND ignore all
empty matches.

For example:
 
<field column="values" sourceColName="values"  splitBy=","/>

I have a some columns that dont have a value for values but so its getting
actually index as blank. I just want to totally ignore those values. Is this
possible?

-- 
View this message in context: http://old.nabble.com/RegexTransformer-tp27897870p27897870.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: RegexTransformer

Posted by blargy <zm...@hotmail.com>.
Thanks for the replies. Ill just roll out my own transformer for this.


Shalin Shekhar Mangar wrote:
> 
> On Mon, Mar 15, 2010 at 2:53 PM, Michael Kuhlmann <
> michael.kuhlmann@zalando.de> wrote:
> 
>> On 03/15/10 08:56, Shalin Shekhar Mangar wrote:
>> > On Mon, Mar 15, 2010 at 2:12 AM, blargy <zm...@hotmail.com> wrote:
>> >
>> >>
>> >> How would I go about splitting a column by a certain delimiter AND
>> ignore
>> >> all
>> >> empty matches.
>> [...]
>> > You will probably have to write a custom Transformer to remove empty
>> values.
>> > See http://wiki.apache.org/solr/DIHCustomTransformer
>> >
>> Shouldn't a PatternTokenizerFactory combined with a LengthFilterFactory
>> do the job?
>>
>> See http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters.
>>
>>
> Yes but only on the indexed values. Empty values will still be stored and
> returned in the response unless you stop them from reaching the indexing
> chain.
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://old.nabble.com/RegexTransformer-tp27897870p27907090.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: RegexTransformer

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Mar 15, 2010 at 2:53 PM, Michael Kuhlmann <
michael.kuhlmann@zalando.de> wrote:

> On 03/15/10 08:56, Shalin Shekhar Mangar wrote:
> > On Mon, Mar 15, 2010 at 2:12 AM, blargy <zm...@hotmail.com> wrote:
> >
> >>
> >> How would I go about splitting a column by a certain delimiter AND
> ignore
> >> all
> >> empty matches.
> [...]
> > You will probably have to write a custom Transformer to remove empty
> values.
> > See http://wiki.apache.org/solr/DIHCustomTransformer
> >
> Shouldn't a PatternTokenizerFactory combined with a LengthFilterFactory
> do the job?
>
> See http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters.
>
>
Yes but only on the indexed values. Empty values will still be stored and
returned in the response unless you stop them from reaching the indexing
chain.

-- 
Regards,
Shalin Shekhar Mangar.

Re: RegexTransformer

Posted by Michael Kuhlmann <mi...@zalando.de>.
On 03/15/10 08:56, Shalin Shekhar Mangar wrote:
> On Mon, Mar 15, 2010 at 2:12 AM, blargy <zm...@hotmail.com> wrote:
> 
>>
>> How would I go about splitting a column by a certain delimiter AND ignore
>> all
>> empty matches.
[...]
> You will probably have to write a custom Transformer to remove empty values.
> See http://wiki.apache.org/solr/DIHCustomTransformer
> 
Shouldn't a PatternTokenizerFactory combined with a LengthFilterFactory
do the job?

See http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters.

Greetings,
Michael

Re: RegexTransformer

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Mar 15, 2010 at 2:12 AM, blargy <zm...@hotmail.com> wrote:

>
> How would I go about splitting a column by a certain delimiter AND ignore
> all
> empty matches.
>
> For example:
>
> <field column="values" sourceColName="values"  splitBy=","/>
>
> I have a some columns that dont have a value for values but so its getting
> actually index as blank. I just want to totally ignore those values. Is
> this
> possible?
>
>
You will probably have to write a custom Transformer to remove empty values.
See http://wiki.apache.org/solr/DIHCustomTransformer

-- 
Regards,
Shalin Shekhar Mangar.