streaming expressions substring-evaluator

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

streaming expressions substring-evaluator

Aroop Ganguly
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
Reply | Threaded
Open this post in threaded view
|

Re: streaming expressions substring-evaluator

Joel Bernstein
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 <[hidden email]>
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
Reply | Threaded
Open this post in threaded view
|

Re: streaming expressions substring-evaluator

Gus Heck
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 <[hidden email]> 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 <[hidden email]>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: streaming expressions substring-evaluator

Joel Bernstein
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
> > 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
>
Reply | Threaded
Open this post in threaded view
|

Re: streaming expressions substring-evaluator

Aroop Ganguly
Thanks for the note Joel.


> On Oct 31, 2018, at 5:55 AM, Joel Bernstein <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
>>> 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
>>