Displaying 14 results from an estimated 14 matches for "create_if_missing".
2005 Dec 02
1
cFerret ETA?
...store, like so:
class Resume < ActiveRecord::Base
include Ferret
has_and_belongs_to_many :users
SEARCH_INDEX = File.dirname(__FILE__) + ''/../../searchindex''
# syncronization with ferret index
def after_save
@@index ||= Index::Index.new(:path => SEARCH_INDEX,
:create_if_missing => true)
@@index << {:id => id, :email => email, :contents => contents,
:date => found_on}
@@index.flush
@@index.optimize
end
def after_destroy
@@index ||= Index::Index.new(:path => SEARCH_INDEX,
:create_if_missing => true)
@@index.delete(id)...
2007 Feb 27
3
segfault in ferret 0.11.0
...updater_unit_test
Started
E/usr/local/lib/ruby/1.8/erb.rb:504: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i686-darwin8.7.1]
Abort trap
When I revert back to 10.14 I dont get this error. When I comment out
the line:
Ferret::Index::Index.new({:path => @index_path, :field_infos => fi,
:create_if_missing => true, :analyzer => StemmedAnalyzer.new})
This error goes away...
If there''s any other things you need to know, let me know and I will be
more than glad to answer any questions.
Cheers,
-Ray
--
Posted via http://www.ruby-forum.com/.
2006 May 08
3
Index::Index.new vs. Readers and Writers
...d firing up a bunch to see if we
get IO blocks.
require ''ferret''
class SearchEngine
include Ferret
include Ferret::Document
def self.get_index()
index_dir = "/var/search/index"
index = Index::Index.new(:path => index_dir,
:create_if_missing => true)
return index
end
end
# Reader/Writer Example
require ''ferret''
class SearchEngine
include Ferret
include Ferret::Document
# Creates or returns an existing index for an organization
def self.get_index(type = ''writer'')
index_dir = &...
2005 Dec 02
1
Compile error on FreeBSD 4.10 gcc 2.95.4
...t
> > has_and_belongs_to_many :users
> > SEARCH_INDEX = File.dirname(__FILE__) + ''/../../searchindex''
> >
> > # syncronization with ferret index
> > def after_save
> > @@index ||= Index::Index.new(:path => SEARCH_INDEX,
> > :create_if_missing => true)
> > @@index << {:id => id, :email => email, :contents => contents,
> > :date => found_on}
> > @@index.flush
> > @@index.optimize
> > end
> >
> > def after_destroy
> > @@index ||= Index::Index.new(:path...
2007 Mar 12
5
index.rb:384 [BUG]
..._entering_queue=[], @default_field=["title"], @key=:id,
@mon_count=0, @auto_flush=true, @open=true, @close_dir=true,
@id_field=:id, @mon_owner=nil, @reader=nil, @searcher=nil,
@options={:lock_retry_time=>2,
:path=>"script/../config/../config/../index/development/article",
:create_if_missing=>true, :default_field=>["title"],
:analyzer=>#<Ferret::Analysis::StandardAnalyzer:0x2b686dc75f78>,
:auto_flush=>true, :or_default=>false,
:dir=>#<Ferret::Store::FSDirectory:0x2b686dc76748>, :key=>:id,
:handle_parse_errors=>true}, @mon_waiting_queue=[]&g...
2005 Dec 08
2
Confusing lock problem in rails
...ing my development on Windows.
Thanks,
Carl
class Resume < ActiveRecord::Base
include Ferret
has_and_belongs_to_many :users
@@index = Index::Index.new(:path => RAILS_ROOT + ''/searchindex'',
:key => :email,
:create_if_missing => true,
:auto_flush => true,
:close_dir => true)
# syncronization with ferret index
def after_save
@@index << {:id => id, :email => email, :contents => contents,
:date => found_on}
end
def after_dest...
2005 Dec 02
43
ANN: acts_as_ferret
...ndex_searcher.close()
result
end
# private
def ferret_create
index ||= Index::Index.new(:key => :id,
:path => INDEX_DIR,
:create_if_missing => true,
:default_field => "*")
index << self.to_doc
index.optimize()
index.close()
end
def ferret_update
#code to update index...
2005 Dec 02
43
ANN: acts_as_ferret
...ndex_searcher.close()
result
end
# private
def ferret_create
index ||= Index::Index.new(:key => :id,
:path => INDEX_DIR,
:create_if_missing => true,
:default_field => "*")
index << self.to_doc
index.optimize()
index.close()
end
def ferret_update
#code to update index...
2007 May 30
4
aaf and dynamic attrs: a bug?
Hi!
I faced some issue while using it for dynamic attrs indexing/search.
Maybe I made something wrong. Here is test method. Everything works just
fine until last line http://pastie.caboo.se/66274 . Tested on both
stable and trunk of aaf and ferret 0.11.4.
the short version of code below:
Contact.acts_as_ferret :fields => [ :first_name ]
assert
2006 Sep 26
3
concurrency / #search_each problem / segfault
...nd
and writing via
Article.ferret_index << self.to_doc
where Article.ferret_index is implemented as in ''act_as_ferret'':
@@ferret_index = nil
def Article::ferret_index
@@ferret_index ||= Ferret::Index::Index.new( :path => ferret_path,
:auto_flush => true, :create_if_missing => false )
end
The 2 errors I got (when I do "doc = index[doc_id]") were :
ArgumentError (:12250 is out of range [0..12243] for IndexWriter#[]):
/usr/lib/ruby/gems/1.8/gems/ferret-0.10.8/lib/ferret/index.rb:382:in
`[]''
/usr/lib/ruby/gems/1.8/gems/ferret-0.10.8/lib/...
2006 Jun 13
1
Obtaining write lock when trying to write index error
...chable_model.rb:5:in `<<''
index.flush
index.optimize
index.close
end
def get_index
Ferret::Index::Index.new(:path => APP::CONFIG[:store_indexes_directory],
:analyzer => FerretConfig::CONTENT_ANALYZER,
:create_if_missing => true)
end
I supposed that working with index this way would be okay (according
to http://ferret.davebalmain.com/trac/wiki/HowTos), but it looks like
i''v missed some kind of top-secret ferret config parameter maybe or
smth., so couldnt you share that trick with me ? (Iam sure every...
2007 Nov 13
8
acts_as_ferret : cannot use a customized Analyzer (as indicated in the AdvancedUsageNotes)
Hi all,
I cannot make aaf (rev. 220) use my custom analyzer, despite following the
indications @
http://projects.jkraemer.net/acts_as_ferret/wiki/AdvancedUsage
To pinpoint the problem, I created a model + a simple analyzer with 2 stop
words : "fax" and "gsm".
test 1 : model.rebuild_index + model.find_by_contents("fax") # fax is a
stop word.
=> I get a
2006 Jun 14
3
In memory IndexReader bug?
Hi All,
Hope all is going well.
I''m having trouble with the following code creating an in memory index
reader - it seems to be attempting to read from a file regardless.
Here''s the simple code:
require ''rubygems''
require ''ferret''
a = Ferret::Index::Index.new
r = Ferret::Index::IndexReader.new(nil)
Running the code on my OS X machine
2005 Dec 19
17
Indexing so slow......
I am indexing over 10,000 rows of data, it is very slow when it is
indexing the 100,1000,10000 row, and now it is over 1 hour passed on
the row 10,000.
how to make it faster?
here is my code:
==================
doc = Document.new
doc << Field.new("id", t.id, Field::Store::YES,
Field::Index::UNTOKENIZED)
doc << Field.new("title", t.title,