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 Aroop Ganguly <ar...@icloud.com> on 2018/10/31 06:37:31 UTC
streaming expressions substring-evaluator
Hey Team
Is there a way to extract a part of a string field and group by on it and obtain a histogram ?
for example the filed value is DateTime of the form: 20180911T00 and
I want to do a substring like substring(field1,0,7), and then do a streaming expression of the form :
rollup(
select(
search(col1,fl=“field1”,sort=“field1 asc”), substring(field1,0,7) as date)
,on= date, count(*)
)
Is there a substring operator available or an alternate in streaming expressions?
Thanks
Aroop
Re: streaming expressions substring-evaluator
Posted by Aroop Ganguly <ar...@icloud.com>.
Thanks for the note Joel.
> On Oct 31, 2018, at 5:55 AM, Joel Bernstein <jo...@gmail.com> wrote:
>
> The replace operator is going to be "replaced" :)
>
> Let's create an umbrella ticket for string operations and list out what
> would be nice to have. They can probably be added very quickly.
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Wed, Oct 31, 2018 at 8:49 AM Gus Heck <gu...@gmail.com> wrote:
>
>> Probably ReplaceWithSubstringOperation (similar to
>> ReplaceWithFieldOperation thought that would probably add another class be
>> subject to https://issues.apache.org/jira/browse/SOLR-9661)
>>
>> On Wed, Oct 31, 2018 at 8:32 AM Joel Bernstein <jo...@gmail.com> wrote:
>>
>>> I don't think there is a substring or similar function. This would be
>> quite
>>> nice to add along with other string manipulations.
>>>
>>> Joel Bernstein
>>> http://joelsolr.blogspot.com/
>>>
>>>
>>> On Wed, Oct 31, 2018 at 2:37 AM Aroop Ganguly <ar...@icloud.com>
>>> wrote:
>>>
>>>> Hey Team
>>>>
>>>>
>>>> Is there a way to extract a part of a string field and group by on it
>> and
>>>> obtain a histogram ?
>>>>
>>>> for example the filed value is DateTime of the form: 20180911T00 and
>>>> I want to do a substring like substring(field1,0,7), and then do a
>>>> streaming expression of the form :
>>>>
>>>> rollup(
>>>> select(
>>>> search(col1,fl=“field1”,sort=“field1 asc”), substring(field1,0,7)
>> as
>>>> date)
>>>> ,on= date, count(*)
>>>> )
>>>>
>>>> Is there a substring operator available or an alternate in streaming
>>>> expressions?
>>>>
>>>> Thanks
>>>> Aroop
>>>
>>
>>
>> --
>> http://www.the111shift.com
>>
Re: streaming expressions substring-evaluator
Posted by Joel Bernstein <jo...@gmail.com>.
The replace operator is going to be "replaced" :)
Let's create an umbrella ticket for string operations and list out what
would be nice to have. They can probably be added very quickly.
Joel Bernstein
http://joelsolr.blogspot.com/
On Wed, Oct 31, 2018 at 8:49 AM Gus Heck <gu...@gmail.com> wrote:
> Probably ReplaceWithSubstringOperation (similar to
> ReplaceWithFieldOperation thought that would probably add another class be
> subject to https://issues.apache.org/jira/browse/SOLR-9661)
>
> On Wed, Oct 31, 2018 at 8:32 AM Joel Bernstein <jo...@gmail.com> wrote:
>
> > I don't think there is a substring or similar function. This would be
> quite
> > nice to add along with other string manipulations.
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> >
> > On Wed, Oct 31, 2018 at 2:37 AM Aroop Ganguly <ar...@icloud.com>
> > wrote:
> >
> > > Hey Team
> > >
> > >
> > > Is there a way to extract a part of a string field and group by on it
> and
> > > obtain a histogram ?
> > >
> > > for example the filed value is DateTime of the form: 20180911T00 and
> > > I want to do a substring like substring(field1,0,7), and then do a
> > > streaming expression of the form :
> > >
> > > rollup(
> > > select(
> > > search(col1,fl=“field1”,sort=“field1 asc”), substring(field1,0,7)
> as
> > > date)
> > > ,on= date, count(*)
> > > )
> > >
> > > Is there a substring operator available or an alternate in streaming
> > > expressions?
> > >
> > > Thanks
> > > Aroop
> >
>
>
> --
> http://www.the111shift.com
>
Re: streaming expressions substring-evaluator
Posted by Gus Heck <gu...@gmail.com>.
Probably ReplaceWithSubstringOperation (similar to
ReplaceWithFieldOperation thought that would probably add another class be
subject to https://issues.apache.org/jira/browse/SOLR-9661)
On Wed, Oct 31, 2018 at 8:32 AM Joel Bernstein <jo...@gmail.com> wrote:
> I don't think there is a substring or similar function. This would be quite
> nice to add along with other string manipulations.
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Wed, Oct 31, 2018 at 2:37 AM Aroop Ganguly <ar...@icloud.com>
> wrote:
>
> > Hey Team
> >
> >
> > Is there a way to extract a part of a string field and group by on it and
> > obtain a histogram ?
> >
> > for example the filed value is DateTime of the form: 20180911T00 and
> > I want to do a substring like substring(field1,0,7), and then do a
> > streaming expression of the form :
> >
> > rollup(
> > select(
> > search(col1,fl=“field1”,sort=“field1 asc”), substring(field1,0,7) as
> > date)
> > ,on= date, count(*)
> > )
> >
> > Is there a substring operator available or an alternate in streaming
> > expressions?
> >
> > Thanks
> > Aroop
>
--
http://www.the111shift.com
Re: streaming expressions substring-evaluator
Posted by Joel Bernstein <jo...@gmail.com>.
I don't think there is a substring or similar function. This would be quite
nice to add along with other string manipulations.
Joel Bernstein
http://joelsolr.blogspot.com/
On Wed, Oct 31, 2018 at 2:37 AM Aroop Ganguly <ar...@icloud.com>
wrote:
> Hey Team
>
>
> Is there a way to extract a part of a string field and group by on it and
> obtain a histogram ?
>
> for example the filed value is DateTime of the form: 20180911T00 and
> I want to do a substring like substring(field1,0,7), and then do a
> streaming expression of the form :
>
> rollup(
> select(
> search(col1,fl=“field1”,sort=“field1 asc”), substring(field1,0,7) as
> date)
> ,on= date, count(*)
> )
>
> Is there a substring operator available or an alternate in streaming
> expressions?
>
> Thanks
> Aroop