Forum: Ferret Missing Ferret 0.9.0 Field methods

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Stuart R. (Guest)
on 2006-04-05 05:19
The following instance methods seem to be missing from the
Ferret::Document::Field class in Ferret 0.9.0 using compiled C
extensions: #string_value, #reader_value and #binary_value. They are in
the pure ruby implementation).

I got round it by mixing in hacked versions of the pure Ruby methods
(@data replaced by self.data).

Many thanks for Ferret it's shaping up to being a killer app for Ruby.
David B. (Guest)
on 2006-04-11 04:04
(Received via mailing list)
Hi Stuart,

Just curious. What do you use those methods for? I didn't bother
including them because I didn't think anyone would need them. It
seemed simpler just to have the one method that returned the data as a
string. I hope I can help.

Cheers,
Dave
Stuart R. (Guest)
on 2006-04-14 08:36
David B. wrote:
> Hi Stuart,
>
> Just curious. What do you use those methods for? I didn't bother
> including them because I didn't think anyone would need them. It
> seemed simpler just to have the one method that returned the data as a
> string. I hope I can help.

The #string_value is used in the Rails HowToIntegrateFerretWithRails
demo application on the Rails Wiki
http://wiki.rubyonrails.com/rails/pages/HowToInteg...

It is used in the ./app/views/search/get_results.rhtml template for
example:

<strong><a href="<%= result.field('url').string_value %>">

I don't know Lucene well enough to know wether there's an alternative
way of doing the the same thing.

I've not come across any usage of the other two methods.

Apologies for the time taken to reply, I've only just spotted your
reply.

Cheers, Stuart

>
> Cheers,
> Dave
David B. (Guest)
on 2006-04-18 07:00
(Received via mailing list)
On 4/14/06, Stuart R. <removed_email_address@domain.invalid> wrote:
> http://wiki.rubyonrails.com/rails/pages/HowToInteg...
>
> It is used in the ./app/views/search/get_results.rhtml template for
> example:
>
> <strong><a href="<%= result.field('url').string_value %>">
>
> I don't know Lucene well enough to know wether there's an alternative
> way of doing the the same thing.

All add the string_value method for backwards compatibility but you
can just use the data method instead.

> I've not come across any usage of the other two methods.
>
> Apologies for the time taken to reply, I've only just spotted your
> reply.

No worries, I took even longer to reply.
This topic is locked and can not be replied to.