search for: indexreader

Displaying 20 results from an estimated 70 matches for "indexreader".

2006 Aug 28
12
Help with Multiple Readers, 1 Writer scenario
...arches if more than one request arrives, so I''d like some advice please about the best way to use multiple readers and one writer. Some background ... query requests which in my case are always read only, arrive via Mongrel, which allocates a thread for each request. Should I create a new IndexReader for each request also, or can I use one IndexReader concurrently? Index updates on the other hand are coordinated by a special Update Thread which runs every 10 minutes or so. I''m guessing that the best approach is to create an IndexWriter for each update run, which can be closed and disc...
2006 Nov 22
1
Help with Multiple Readers, 1 Writer scenario
Some time back in September, [sorry to be so slow], Dave wrote: > When you open an IndexReader on the index it is opened up on > that particular version (or state) of the index. So any > operations on the IndexReader (like searches) will only show > what was in the index at the time you opened it. Any modifications > to the index (usually through and IndexWriter) that occur a...
2006 Jun 14
3
In memory IndexReader bug?
...9;'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 gives: marcus-crafters-powerbook-g4-17:/tmp crafterm$ ruby t.rb t.rb:5:in `initialize'': : Error occured at <fs_store.c>:318 (Exception) Error: exception 2 not handled: Couldn''t open the file to read from t.rb:5 The Inde...
2006 Feb 17
1
IndexReader NotImplemented
Hi there, Sorry if this has come up before, but I couldn''t see it obviously addressed anywhere. There are a few methods in IndexReader that raise NotImplementedErrors. I''m specifically interested in get_term_vector, but there are a number of others. Is there anything specific holding these back, or would patches to implement them be accepted? Thanks, -- Alex
2008 Jan 09
5
Parallel indexing doesn''t work?
...#39;'rubygems'' require ''ferret'' include Ferret::Index 5.times do |i| name = "index#{i}" puts name i = Ferret::I.new(:path => "/tmp/#{i}", :create => true) i << {:name => name} i.close end readers = [] readers << IndexReader.new("/tmp/0") readers << IndexReader.new("/tmp/1") readers << IndexReader.new("/tmp/2") readers << IndexReader.new("/tmp/3") readers << IndexReader.new("/tmp/4") index_writer = IndexWriter.new(:path => "/tmp/test&quot...
2007 Mar 04
5
Getting non-stemmed terms from IndexReader
I need to get a set of terms being indexed using Ferret. I used IndexReader.terms and it returns a list of TermEnum nicely. The only problem is that my analyzer includes a stemming filter. So now, the terms I''m getting back are all stemmed. Is there anyway to get the original unstemmed terms back from the index somehow? Thanks. -- Posted via http://www.ruby-foru...
2007 Jul 29
7
RDig and AAF playing together
...her.search will not "see" the changes to Index B until I restart Mongrel (or restart script/console). If I query Index B directly through ClassB.find_by_contents("myfield:my_value") I see the updated results immediately with no restart. I know that RDig creates a single IndexReader for class. Does the IndexReader cache the segments files in memory? Does anyone have any ideas? Thanks in advance for your help! Erik
2006 Feb 28
2
Most Popular Searches
...index for the most popular urls. In SQL I would do this via a Group By clause. Is there anything in Ferret that will do something similar? I found this discussion that proposed a solution involving TermEnums: http://www.gossamer-threads.com/lists/lucene/java-user/32272#32272 But I noticed the IndexReader.terms and IndexReader.term_docs are not implemented. Is that solution the way to go? Would an index-only solution perform a lot faster than a pure database solution using a group by clause? Any feedback is appreciated. Tom
2007 Apr 09
5
IndexReader#terms for all fields?
Is it possible to query the index for a TermEnum for all fields in the index instead of just ? Thanks, John
2007 Mar 01
2
FerretHash
...(Code is below.) This class offers a simplified Hash-like interface to (a very restricted subset of) Ferret. Hence I call it FerretHash. FerretHash comes with its very own pet Ferret bug. Run the crude unit test to see the problem. (Long story short, it looks like term frequency, as reported by IndexReader#terms, does not take deletions into account.) require ''rubygems'' require ''ferret'' require ''tempfile'' class FerretHash def initialize(name=nil) #make temp file name unless path tf=Tempfile.new("ferrethash_#$$")...
2007 Jun 16
2
more specific queries via IndexReader
We would like to show a list of "most recently added terms", meaning, the results of this query: Resource.aaf_index.ferret_index.reader.terms(:summary) BUT, only returning terms from a certain set of documents (in our case, we are going to filter by creation data). Is this possible? Thanks, John
2006 Sep 22
3
Error with :create => true and existing index
...prexisting index. The "reindexing" seems to start out ok, with several thousand docs added, then Ferret throws an exception: IO Error occured: couldn''t rename file "index\_0.tmp" to "index\_0.cfs": <File exists> I guess that _0.cfs is held open by an IndexReader, so the :create is failing to delete it and hence the rename is failing. Kind Regards Neville
2007 Jun 12
5
index browser inconsistent with IndexReader
...#39;s included with version 0.11.4 showed the document with all its fields intact, including the :data field. All the :data field terms that failed to retrieve the document on the web app were indeed present, according to the browser. We then built a short script with the API that instantiated an IndexReader and called IndexReader.term_vectors() with the id of our subject doc. The term_vectors returned included a vector for :keywords, but not for :data. Somehow the core API funcs are not finding this document''s :data field when the 0.11.4 browser is. Are there differences between the two th...
2007 Jul 19
1
highlighting from multiple indexes
Hi. I''m searching multiple indexes by passing an array of paths to Index::IndexReader.new(). I get several hits back, and can determine the document id of each. Now I want to fetch highlighted excerpts from a field in one of the matched documents. The problem I''m having is that Index::IndexReader doesn''t have a highlight() method. And, while Index::Index doe...
2007 Apr 03
2
How can I count frequency of terms in a document?
Hi, there. I need some help. Is there a way to count frequencies of terms in a document on Ferret? I know that Ferret has IndexReader#terms_docs_for method which counts all documents. I need to count frequencies of terms in a specific document. Some way?? -- Posted via http://www.ruby-forum.com/.
2006 May 08
3
Index::Index.new vs. Readers and Writers
...e = ''writer'') index_dir = "/var/search/index" if type == ''writer'' index = Index::IndexWriter.new(index_dir, :create_if_missing => true) elsif type == ''reader'' index = Index::IndexReader.open(index_dir, false) end return index end end Thanks!! - Shanti -- Posted via http://www.ruby-forum.com/.
2005 Nov 17
6
lock problems from concurrent processes.
Hi! First, thanks a LOT for ferret. The API and documentation is great. I''m trying to integrate ferret into a RoR app (DamageControl) and have run into a problem with locks. DamageControl consists of two processes that start up and run in parallel. The first one is the webapp (which is just a plain RoR app). The second is a daemon process that runs in the background. The daemon process
2006 Aug 03
2
Index.optimize
In the documentation, it says that optimize "should only be called when the index will no longer be updated very often, but will be read a lot". Does this mean it actually has a detrimental impact on updates and inserts? In my project there will be many more reads than updates, but there will still be a lot of updates. So should I be calling Optimize once a day or something like that,
2006 Aug 23
2
Reworking the Index Constructor
Hey .. I was thinking about the way I need to use the Ferret::Index::Index Class and its subclasses .. i find it somehow complex .. I think this can be done more easily .. Most of the Time a user needs to open up a index to do queries, the best way would be to use a IndexReader afaik. I would suggest to do it that way: index = Ferret::Index::Index.new( :path => ''/some/path'', :readonly => true ) i guess this is far easier than using the Ferret::Index::IndexReader. Other parameters like auto_flush can be ignored....
2007 Dec 17
3
are index files cross-platform?
Hello! I am trying to read Ferret index files from Windows machine on my Mac G5 Leopard machine, but the following returns nil: Ferret::Index::IndexReader.new( index_paths ) Should this work? Are index files guaranteed to be platform independent or not? Is there any problem if files (top direectory) are renamed? izidor P.S. I can create the index myself and then everything works.