search for: doc_num

Displaying 12 results from an estimated 12 matches for "doc_num".

Did you mean: dev_num
2006 May 12
4
validates_uniqueness_of with a condition
Hi, I need to check the uniqueness of an attribute (a doc number) using a condition (a specific year), I''ve found validates_uniqueness_of :number, but I need to tell it I just want to check a specific year. I''ve found :scope but I haven''t really understood it''s meaning, Can I scope on a specific year? Thanks, Enrico -- "The only thing necessary for the
2005 Nov 26
3
Get number of found documents
...e it returns an array of found documents. What if such documents will be 100000?? I don''t want to select all this documents, just to know how many found, and then select for example 10 of them index.search_each(query, :num_docs=>PAGE_SIZE, :first_doc=>PAGE_SIZE*(page_num-1)) do |doc_num, score| @documents << index[doc_num] end So quesition is: what is the most effective way to calculate (just calculate) number of found documents? -- anatol (http://pomozov.info) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pi...
2007 Mar 09
5
higlighting problem
Hi, I''ve been having a problem getting highlighting to work with aaf. I have a class defined as follows such: class Link < ActiveRecord::Base acts_as_ferret :fields => { :description => { :store => :yes } } end I get back the correct results when I do Link.find_by_contents, however, I''d like to highlight them. If I do something like iterate through the list of
2006 Sep 05
4
Ferret 0.10.2 - Index#search_each() and :num_docs
...:name => ''Dr Strange'', :occupation => ''Hero''} idx << {:id => 11, :name => ''Phantom'', :occupation => ''Hero''} p idx.size docs = [] query = ''occupation:(hero toon)'' idx.search_each(query, :doc_num => idx.size) { |doc, score| docs << idx[doc] } p query p docs.length ============= ruby idx.rb "0.10.2" 11 "occupation:(hero toon)" 10
2005 Dec 02
4
How to get the count of matching documents
I''m trying to generate a rails pagination helper for some ferret search results, and I need to know how many total matches there are to my search query. I don''t see an obvious way of finding this. Any help would be appreciated. Thanks, Carl Youngblood
2007 Apr 06
3
Count frequency of term in a specific document?
Is there any way to count the frequency of specific term in one document? I can''t find any method... Do you? -- Posted via http://www.ruby-forum.com/.
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 Oct 12
3
Ferret::StateError while using acts_as_ferret
...currently running Ferret 0.10.11 with acts_as_ferret (latest via svn external) and 3 times today I''ve seen the following error in production: A Ferret::StateError occurred in directory#search: State Error occurred at <except.c>:79 in xraise Error occurred in index.c:2098 - stde_doc_num Illegal state of TermDocEnum. You must call #next before you call #doc_num /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.11/lib/ferret/index.rb:370:in `search.each'' The index in question is on a single model and contains about 330K items. I''m not doing anything unus...
2007 Jun 28
0
Is anyone using ferret on Solaris/SPARC?
...rb_bug (fmt=0xb7908 "Bus Error") at error.c:214 #4 0x0007e0b8 in sigbus (sig=73) at signal.c:605 #5 0xff1bfed0 in __sighndlr () from /lib/libc.so.1 #6 0xff1b4ffc in call_user_handler () from /lib/libc.so.1 #7 0xfdf43668 in dw_add_posting (mp=0x13e7590, curr_plists=0x0, fld_plists=0xa, doc_num=0, text=0x1e64d2c "policies", len=8, pos=1) at index.c:4832 #8 0xfdf437b0 in dw_invert_field (dw=0x1dfab28, fld_inv=0x206c810, df=0x13e74f0) at index.c:5218 #9 0xfdf43a8c in dw_add_doc (dw=0x1dfab28, doc=0x99f5e0) at index.c:5288 #10 0xfdf44e54 in iw_add_doc (iw=0x1dfaa00, doc=0x99f...
2007 Feb 07
0
"Illegal state of TermDocEnum" error
Hi, I''ve upset Ferret (again). When searching for: "us military" -bomb I get the following exception: State Error occured at <except.c>:79 in xraise Error occured in index.c:2089 - stde_doc_num Illegal state of TermDocEnum. You must call #next before you call #doc_num If I drop the quotes around "us military", or drop "-bomb", it works fine. I can search for -bomb on it''s own, and other variations successfully. I''ve tried recreating the index from...
2006 May 26
8
Comparing two documents in the index
I want to compare two documents in the index (i.e. retrieve the cosine similarity/score between two documents term-vector''s). Is this possible using the standard Ferret functionality? Thanks in advance, Jeroen Bulters -- Posted via http://www.ruby-forum.com/.
2006 Jun 04
20
Proposal of some radical changes to API
Hey guys, Now that the Lucy[1] project has Apache approval and is about to begin, the onus is no longer on Ferret to strive for Lucene compatability. (We''ll be doing that in Lucy). So I''m starting to think about ways to improve Ferret''s API. The first part that needs to be improved is the Document API. It''s annoying having to type all the attributes to