You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Bryan Rojo <Br...@elliottelectric.com> on 2018/04/12 17:08:38 UTC
ITermAttribute SetTermBuffer migration from 3.0.3
I see that ITermAttribute was replaced by ICharTermAttribute in 4.0
I previously used TermAttribute.SetTermBuffer(string) but there is no longer an overload that simply takes a string as a parameter, plus I can't create a wrapper because the Support.TextSupport class was also removed
The method CopyBuffer is the new way to do this but Im not sure how I can call it with just a string
Thank You for your help!
RE: ITermAttribute SetTermBuffer migration from 3.0.3
Posted by Bryan Rojo <Br...@elliottelectric.com>.
Thank you!!!!
Y'all are the best
-----Original Message-----
From: Bob Entwhistle [mailto:bob@snapstream.com]
Sent: Thursday, April 12, 2018 4:13 PM
To: user@lucenenet.apache.org
Subject: Re: ITermAttribute SetTermBuffer migration from 3.0.3
Hi Bryan,
You just need to convert the string to a char array. Something like this should work for you:
termAtt.CopyBuffer( buffer.ToCharArray(), 0 , buffer.Length );
Cheers
Bob
On Thu, Apr 12, 2018 at 12:08 PM, Bryan Rojo <Br...@elliottelectric.com>
wrote:
> I see that ITermAttribute was replaced by ICharTermAttribute in 4.0
>
> I previously used TermAttribute.SetTermBuffer(string) but there is no
> longer an overload that simply takes a string as a parameter, plus I
> can't create a wrapper because the Support.TextSupport class was also
> removed
>
> The method CopyBuffer is the new way to do this but Im not sure how I
> can call it with just a string
>
>
> Thank You for your help!
>
Re: ITermAttribute SetTermBuffer migration from 3.0.3
Posted by Bob Entwhistle <bo...@snapstream.com>.
Hi Bryan,
You just need to convert the string to a char array. Something like this
should work for you:
termAtt.CopyBuffer( buffer.ToCharArray(), 0 , buffer.Length );
Cheers
Bob
On Thu, Apr 12, 2018 at 12:08 PM, Bryan Rojo <Br...@elliottelectric.com>
wrote:
> I see that ITermAttribute was replaced by ICharTermAttribute in 4.0
>
> I previously used TermAttribute.SetTermBuffer(string) but there is no
> longer an overload that simply takes a string as a parameter, plus I can't
> create a wrapper because the Support.TextSupport class was also removed
>
> The method CopyBuffer is the new way to do this but Im not sure how I can
> call it with just a string
>
>
> Thank You for your help!
>