You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Dan Rosher <ro...@gmail.com> on 2022/06/29 14:27:50 UTC
Partial updates with Update Stream Decorator
Hi,
Is it possible to do partial/atomic or in-place updates with Update
Streaming expression Decorator? The following simply overwrites.
update(collection1,
select(
search(collection1,
q=*:*,
qt="/export",
fl="id,a_s,a_i,a_f,s_multi,i_multi",
sort="a_f asc, a_i asc"))
,id,a_s)
Thanks,
Dan
Re: Partial updates with Update Stream Decorator
Posted by Dan Rosher <ro...@gmail.com>.
I've just added SOLR-16287 if you want to have a look and try it out.
On Thu, 7 Jul 2022 at 13:18, Eric Pugh <ep...@opensourceconnections.com>
wrote:
> Something worth sharing?
>
> > On Jul 7, 2022, at 3:59 AM, Dan Rosher <ro...@gmail.com> wrote:
> >
> > No unfortunately I had to make my own streaming function to create the
> > mapping, works like this:
> >
> > map(<stream>,"cand_id=add-distinct") to take the value for cand_id (say
> v)
> > and make a tuple like cand_id = new Tuple(add-distinct,v) and pass
> through
> > everything else
> >
> > On Wed, 6 Jul 2022 at 22:12, Joel Bernstein <jo...@gmail.com> wrote:
> >
> >> That would be quite tricky to create with existing functions. Did you
> find
> >> a way to inject a tuple into a field?
> >>
> >> Joel Bernstein
> >> http://joelsolr.blogspot.com/
> >>
> >>
> >> On Wed, Jul 6, 2022 at 12:10 PM Dan Rosher <ro...@gmail.com> wrote:
> >>
> >>> Answering my own question, this IS possible but you need to send to the
> >>> update streaming expression, a tuple list like the following in order
> to
> >> do
> >>> atomic/in-place updates:
> >>>
> >>> { "result-set": { "docs": [ { "cand_id": { "add-distinct": 5718 },
> "id":
> >>> "2644126" }, { "cand_id": { "add-distinct": 7408 }, "id": "2658316" },
> >>> ...
> >>>
> >>> Cheers,
> >>> Dan
> >>>
> >>> On Wed, 29 Jun 2022 at 15:27, Dan Rosher <ro...@gmail.com> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> Is it possible to do partial/atomic or in-place updates with Update
> >>>> Streaming expression Decorator? The following simply overwrites.
> >>>>
> >>>> update(collection1,
> >>>> select(
> >>>> search(collection1,
> >>>> q=*:*,
> >>>> qt="/export",
> >>>> fl="id,a_s,a_i,a_f,s_multi,i_multi",
> >>>> sort="a_f asc, a_i asc"))
> >>>> ,id,a_s)
> >>>>
> >>>> Thanks,
> >>>> Dan
> >>>>
> >>>
> >>
>
> _______________________
> Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 |
> http://www.opensourceconnections.com <
> http://www.opensourceconnections.com/> | My Free/Busy <
> http://tinyurl.com/eric-cal>
> Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <
> https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
>
> This e-mail and all contents, including attachments, is considered to be
> Company Confidential unless explicitly stated otherwise, regardless of
> whether attachments are marked as such.
>
>
Re: Partial updates with Update Stream Decorator
Posted by Eric Pugh <ep...@opensourceconnections.com>.
Something worth sharing?
> On Jul 7, 2022, at 3:59 AM, Dan Rosher <ro...@gmail.com> wrote:
>
> No unfortunately I had to make my own streaming function to create the
> mapping, works like this:
>
> map(<stream>,"cand_id=add-distinct") to take the value for cand_id (say v)
> and make a tuple like cand_id = new Tuple(add-distinct,v) and pass through
> everything else
>
> On Wed, 6 Jul 2022 at 22:12, Joel Bernstein <jo...@gmail.com> wrote:
>
>> That would be quite tricky to create with existing functions. Did you find
>> a way to inject a tuple into a field?
>>
>> Joel Bernstein
>> http://joelsolr.blogspot.com/
>>
>>
>> On Wed, Jul 6, 2022 at 12:10 PM Dan Rosher <ro...@gmail.com> wrote:
>>
>>> Answering my own question, this IS possible but you need to send to the
>>> update streaming expression, a tuple list like the following in order to
>> do
>>> atomic/in-place updates:
>>>
>>> { "result-set": { "docs": [ { "cand_id": { "add-distinct": 5718 }, "id":
>>> "2644126" }, { "cand_id": { "add-distinct": 7408 }, "id": "2658316" },
>>> ...
>>>
>>> Cheers,
>>> Dan
>>>
>>> On Wed, 29 Jun 2022 at 15:27, Dan Rosher <ro...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Is it possible to do partial/atomic or in-place updates with Update
>>>> Streaming expression Decorator? The following simply overwrites.
>>>>
>>>> update(collection1,
>>>> select(
>>>> search(collection1,
>>>> q=*:*,
>>>> qt="/export",
>>>> fl="id,a_s,a_i,a_f,s_multi,i_multi",
>>>> sort="a_f asc, a_i asc"))
>>>> ,id,a_s)
>>>>
>>>> Thanks,
>>>> Dan
>>>>
>>>
>>
_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | My Free/Busy <http://tinyurl.com/eric-cal>
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.
Re: Partial updates with Update Stream Decorator
Posted by Dan Rosher <ro...@gmail.com>.
No unfortunately I had to make my own streaming function to create the
mapping, works like this:
map(<stream>,"cand_id=add-distinct") to take the value for cand_id (say v)
and make a tuple like cand_id = new Tuple(add-distinct,v) and pass through
everything else
On Wed, 6 Jul 2022 at 22:12, Joel Bernstein <jo...@gmail.com> wrote:
> That would be quite tricky to create with existing functions. Did you find
> a way to inject a tuple into a field?
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Wed, Jul 6, 2022 at 12:10 PM Dan Rosher <ro...@gmail.com> wrote:
>
> > Answering my own question, this IS possible but you need to send to the
> > update streaming expression, a tuple list like the following in order to
> do
> > atomic/in-place updates:
> >
> > { "result-set": { "docs": [ { "cand_id": { "add-distinct": 5718 }, "id":
> > "2644126" }, { "cand_id": { "add-distinct": 7408 }, "id": "2658316" },
> > ...
> >
> > Cheers,
> > Dan
> >
> > On Wed, 29 Jun 2022 at 15:27, Dan Rosher <ro...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Is it possible to do partial/atomic or in-place updates with Update
> > > Streaming expression Decorator? The following simply overwrites.
> > >
> > > update(collection1,
> > > select(
> > > search(collection1,
> > > q=*:*,
> > > qt="/export",
> > > fl="id,a_s,a_i,a_f,s_multi,i_multi",
> > > sort="a_f asc, a_i asc"))
> > > ,id,a_s)
> > >
> > > Thanks,
> > > Dan
> > >
> >
>
Re: Partial updates with Update Stream Decorator
Posted by Joel Bernstein <jo...@gmail.com>.
That would be quite tricky to create with existing functions. Did you find
a way to inject a tuple into a field?
Joel Bernstein
http://joelsolr.blogspot.com/
On Wed, Jul 6, 2022 at 12:10 PM Dan Rosher <ro...@gmail.com> wrote:
> Answering my own question, this IS possible but you need to send to the
> update streaming expression, a tuple list like the following in order to do
> atomic/in-place updates:
>
> { "result-set": { "docs": [ { "cand_id": { "add-distinct": 5718 }, "id":
> "2644126" }, { "cand_id": { "add-distinct": 7408 }, "id": "2658316" },
> ...
>
> Cheers,
> Dan
>
> On Wed, 29 Jun 2022 at 15:27, Dan Rosher <ro...@gmail.com> wrote:
>
> > Hi,
> >
> > Is it possible to do partial/atomic or in-place updates with Update
> > Streaming expression Decorator? The following simply overwrites.
> >
> > update(collection1,
> > select(
> > search(collection1,
> > q=*:*,
> > qt="/export",
> > fl="id,a_s,a_i,a_f,s_multi,i_multi",
> > sort="a_f asc, a_i asc"))
> > ,id,a_s)
> >
> > Thanks,
> > Dan
> >
>
Re: Partial updates with Update Stream Decorator
Posted by Dan Rosher <ro...@gmail.com>.
Answering my own question, this IS possible but you need to send to the
update streaming expression, a tuple list like the following in order to do
atomic/in-place updates:
{ "result-set": { "docs": [ { "cand_id": { "add-distinct": 5718 }, "id":
"2644126" }, { "cand_id": { "add-distinct": 7408 }, "id": "2658316" },
...
Cheers,
Dan
On Wed, 29 Jun 2022 at 15:27, Dan Rosher <ro...@gmail.com> wrote:
> Hi,
>
> Is it possible to do partial/atomic or in-place updates with Update
> Streaming expression Decorator? The following simply overwrites.
>
> update(collection1,
> select(
> search(collection1,
> q=*:*,
> qt="/export",
> fl="id,a_s,a_i,a_f,s_multi,i_multi",
> sort="a_f asc, a_i asc"))
> ,id,a_s)
>
> Thanks,
> Dan
>