Subject RE: [firebird-support] rtf-to-plaintext udf?
Author Alan McDonald
> Hello Alan,
>
> thanks for your various replies.
>
> I will have a closer look at trichview.com. On first glance it looks
> very nice. But I'll have to find out if I will need all the features I
> have to pay for ;-).
>
> What I really have to think about is your comment about the client side
> and time used in an UDF. It would be easier to do transformation in an
> application, but the database relies on it.
> What I want to do is:
> I have several blob fields containing rtf text.
> For a kind of full text search engine I have a table with words that are
> extracted from several fields on INSERT and UPDATE.
> For the VARCHAR fields and the plain text blobs this is already solved
> (although probably not very efficently).
> What I don't know yet is how to extract the words from rtf fields, i.e.
> how to transform the rtf to plain text.
> As the extraction UDFs will get wrong results when run against rtf text
> the database depends on getting plain text.
>
> The only way I could think of when not realizing the extraction in an
> UDF is to have an additional plain text field and "force" any
> application to do the transformation by defining this field as NOT NULL.
>
> Given this scenario, do you still think the UDF would be the wrong place
> to do the transformation?
>
> Urs

You can always do with UDF's what doing with UDFs will permit. Sorry for the
operational definition.
But I'm not sure what thread safety is possible with the creation of these
objects inside your DLL. UDFs get loaded once and get called over and over.
These high level object are little risky in my mind.
There are other full text search components around - have you tried IBO full
text search? I don't use it but I see good comments about it. It won't work
with RTF as you say, but if the client is the place where this text is
actually created, then the client (to me anyway) is the best place to parse
this stuff. But that assumes you are doing the front end yourself too. If
you are only offering a backend solution then you are stuck with trying to
solve it the way you are going.
Alan