Errror on update after Model.rebuild_index

Hi

I use Ferret 0.11.4 and the latest stabel version of the acts_as_ferret
plugin.

To the issue. if I do Model.rebuild_index and after that try to update
one of my objects of that Model I get:

File Not Found Error occured at <except.c>:117 in xpop_context
Error occured in fs_store.c:329 - fs_open_input
tried to open
“/Users/mattias/Sites/thm/photo_archive/index/development/asset/_b.cfs”
but it doesn’t exist:

If I delete the entire index folder and update again it works fine. it
breaks only if I do Model.rebuild_index.

Any suggestions?

More info:
I can also make it work by doing.

Model.rebuild_index
Model.find_by_contents

Then i can update/save a record again.

On 2007-06-08, at 1:29 PM, Mattias B. wrote:

If I delete the entire index folder and update again it works fine. it
breaks only if I do Model.rebuild_index.

hey … sounds like you had another process access/modify the
index… did you try it with the ferret drb server?

Ben

On Fri, Jun 08, 2007 at 01:41:34PM +0200, Mattias B. wrote:

No - local index.

is this in development mode with 1 mongrel instance? if yes, make sure
your Mongrel doesn’t do index updates while you run rebuild_index from
the console. Even better, run these tests without mongrel running, or in
another RAILS_ENV.

With multiple mongrels, use the DRb server.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

Benjamin K. wrote:

On 2007-06-08, at 1:29 PM, Mattias B. wrote:

If I delete the entire index folder and update again it works fine. it
breaks only if I do Model.rebuild_index.

hey … sounds like you had another process access/modify the
index… did you try it with the ferret drb server?

Ben

No - local index.

Mattias B. wrote:

Jens K. wrote:

On Fri, Jun 08, 2007 at 01:41:34PM +0200, Mattias B. wrote:

No - local index.

is this in development mode with 1 mongrel instance? if yes, make sure
your Mongrel doesn’t do index updates while you run rebuild_index from
the console. Even better, run these tests without mongrel running, or in
another RAILS_ENV.

With multiple mongrels, use the DRb server.

Jens

I turned of mongrel and rebuilt - and it worked.

Thanks for the help

When moving this to the production server it fails again. Here i have
the same vesion of the gem and plug-in. The server runs lighttpd and
fast-cgi. i can’t re-index this class if it has :index => :no. if I
remove this from the :fields it works again.

Looks like this
acts_as_ferret({:store_class_name => true,
:fields => { :title => {},
:date_comment_index => {:index => :no}
}
}, { :analyzer =>
Ferret::Analysis::StandardAnalyzer.new([]) })

As I said, if i remove :index => :no it works.

Is the solution to change to DRb?

mattias

Jens K. wrote:

On Fri, Jun 08, 2007 at 01:41:34PM +0200, Mattias B. wrote:

No - local index.

is this in development mode with 1 mongrel instance? if yes, make sure
your Mongrel doesn’t do index updates while you run rebuild_index from
the console. Even better, run these tests without mongrel running, or in
another RAILS_ENV.

With multiple mongrels, use the DRb server.

Jens

I turned of mongrel and rebuilt - and it worked.

Thanks for the help

On Thu, Jun 14, 2007 at 06:35:12PM +0200, Mattias B. wrote:

fast-cgi. i can’t re-index this class if it has :index => :no. if I
As I said, if i remove :index => :no it works.

Is the solution to change to DRb?

At least you should give it a try. However I cannot imaging how having a
field indexed or not should influence rebuilding.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

On Fri, Jun 15, 2007 at 11:17:27AM +0200, Mattias B. wrote:

/vendor/plugins/acts_as_ferret/lib/local_index.rb:217:in `add_field'

Does this help?

yeah, jusat do what it says - disable term vector storage by adding
:term_vector => :no to the field options for the :index => :no field.

AAF trunk now should handle this correctly :slight_smile:

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

Hi,

I’m not sure if this has been brought up before: I found a bug in
StandardTokenizer which misinterprets non-ASCII characters as word
boundaries. This happens only with words that contain non-
alphanumeric characters.

Consider this example:

The text ‘Gerd Schröder Straße’ is properly tokenized to:

[“Gerd”, “Schröder”, “Straße”]

as well as ‘Gerd-Schroeder-Strasse’:

[“Gerd-Schroeder-Strasse”]

but ‘Gerd-Schröder-Straße’ yields:

[“Gerd-Schr”, “öder-Stra”, “ße”]

So apparently, multibyte and non-word characters don’t mix…

Cheers,
Andy

Jens K. wrote:

On Fri, Jun 15, 2007 at 11:17:27AM +0200, Mattias B. wrote:

/vendor/plugins/acts_as_ferret/lib/local_index.rb:217:in `add_field'

Does this help?

yeah, jusat do what it says - disable term vector storage by adding
:term_vector => :no to the field options for the :index => :no field.

AAF trunk now should handle this correctly :slight_smile:

Jens

I have the trunk version. This removes the error but the search doen’t
match what I was looking for. I have a large number of dates in
dirrerent formats.

Like this one 6.9.-8.9. 1796

When I search for 6.9.* - the result is blank. I’m maybee missing
something here.

mattias

On Fri, Jun 15, 2007 at 05:16:49PM +0200, Mattias B. wrote:

AAF trunk now should handle this correctly :slight_smile:
something here.
if this date string is in the date_comment_index field, you won’t find
it as long as you say :index => :no. The correct choice for fields you
want to search, but not to be tokenized is :index => :untokenized.

:index => :no is only useful for fields you never want to search, but
which should hold data to be retrieved later on.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

Jens K. wrote:

On Fri, Jun 15, 2007 at 05:16:49PM +0200, Mattias B. wrote:

AAF trunk now should handle this correctly :slight_smile:
something here.
if this date string is in the date_comment_index field, you won’t find
it as long as you say :index => :no. The correct choice for fields you
want to search, but not to be tokenized is :index => :untokenized.

:index => :no is only useful for fields you never want to search, but
which should hold data to be retrieved later on.

Jens

Yes - I ran into that. After a lot of tests I now use
untokenized_omit_norms which seems to give the correct result. Now I
only have to index the date_comment twice. It also holds unsurten dates
lite Around 1820. These chould be searchable with “Around” (find al
unsurten dates)

So now I index
:date_comment_index => {},
:date_comment_index_untokenized => {:index => :untokenized_omit_norms}

mattias

Jens K. wrote:

On Thu, Jun 14, 2007 at 06:35:12PM +0200, Mattias B. wrote:

fast-cgi. i can’t re-index this class if it has :index => :no. if I
As I said, if i remove :index => :no it works.

Is the solution to change to DRb?

At least you should give it a try. However I cannot imaging how having a
field indexed or not should influence rebuilding.

Jens

Yes - it’s very strange. This is what I get:

ArgumentError (Argument Error occured at <except.c>:93 in xraise
Error occured in index.c:270 - fi_check_params
You can’t store the term vectors of an unindexed field

):
/vendor/plugins/acts_as_ferret/lib/local_index.rb:217:in `add_field’

Does this help?

mattias

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs