Displaying 20 results from an estimated 4000 matches similar to: "Could not get all matched docs"
2006 Sep 05
4
Ferret 0.10.2 - Index#search_each() and :num_docs
Hi,
I seem to be having trouble getting more than 10 hits from
Index#search_each since upgrading to 0.10.2 (ie, this was working in
0.9.4). Maybe a bug, as the #search_each doesn''t seem to use the options
parameter any more ?
Thanks,
Neville
===========================================
require ''rubygems''
require ''ferret''
p Ferret::VERSION
idx =
2005 Nov 26
3
Get number of found documents
Hi David again.
I would say that Ferret works great with Rails.
And now I am trying to create pagination. Because site could have millions
of documents I need to create on page link something like
"Page #100". Rather usual situation.
But to create this links I need to know how many documents Ferret found in
index.
For now I am doing it with following code
index =
2003 Jun 09
1
unable to read superblock ?
Hi, I have a machine setup as software-raid + ext3 + redhat ,
but this morning, it seems the file system crash. here is
the booting message, anyone has any idea how to fix it.
Thanks!
Donghui
----------------------------------------------------------------------------
------
md: adding sda1
md: created md2
md: using <sdb1> <sda1>
md: md2: raid array is not clean -- starting
2006 Jan 10
1
search_each returns partial results?
Hi,
I''m having some trouble with ferret search_each. I''m posting rails''
script/console output, so I guess you can decrypt it:
>> res = []
=> []
>> index.search_each(''name: a*'') do |doc, score|
?> res << doc
>> end
=> 50
>> res.size
=> 10
>>
I''m guessing the ''=>50''
2006 Mar 01
2
Sorting the Result
The document describes
search(query, options)
sort: An array of SortFields describing how to sort the results.
I have created index with two fields: ''file'' and ''content''
When I give SortField name as ''file'' while searching, it results into
error.
The exact command given by me:
index.search_each("sleepless AND dreams", :num_docs
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
2006 Jul 14
18
adding a custom filter to the query
Hi all,
I''m trying to figure out how to add a filter into a search. I''ve
created the filter, basically copying the location filter from
http://blog.tourb.us/archives/ferret-and-location-based-searches. But
when I try to call Index.search and pass the filter in a hash with the
key :filter, I get back that it is expecting type Data, and so I''m at
a loss to figure out
2006 Jun 22
3
Partition results based on field
Hello all
I''m using Ferret for a site wide search where I have several kinds of
(similar) objects in a central index (using a "type" field containing
the class name). This works great, and I can search all objects with one
query.
What I''d like to do now is to limit the results so that there will be a
maximum of 10 (or 5 or whatever) results for each type.. I
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
2006 Jul 10
11
Category Number Results returned
I am looking to have a number of categories populated from my results of
a search. For example, searching on "sport" would display all results
for sport. I want to also have a number of categories to refine the
documents down. So by clicking on the "Fishing" category or the
"Shooting" category, I would only see the results on sport around that
category.
Now for
2006 Jul 12
5
Reverse sorting
I am getting strange results when I reverse sort a query. I am sorting
by date, but it doesn''t seem to be related to dates (I have tried just
integers). I also paginate the results. Items in the result set are
sometimes duplicated and the not ordered at all. When I try a
non-reverse sort I don''t see duplicates and the ordering is correct. Any
ideas what is going on? Thanks
2006 Jun 29
13
find_by_contents not returning SearchResults?
The acts_as_ferret documentation says find_by_content returns an
instance of SearchResults, but I see this error when I try to use the
results.
undefined method `total_hits'' for []:Array
Here is the link to the documentation:
http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000010
But here is the actual code:
result =
2006 Jul 05
1
search speed eclipsed by retrieval speed
Hi all,
I''ve recently started working with Ferret and I''m getting what seems to
be slow searches. I have about 10000 documents in the index, with
several fields per document, with some fields having an array of several
values that are indexed.
I am using a RAMDirectory to store the index for searching. When doing
testing, I find that searches are reasonable at around .2 to
2007 Jun 22
1
Switching X-axis and Y-axis for histogram
Dear all,
I'm creating a histogram with the function hist(). But
right now what I get is column representation (as normal).
I'm wondering if I could switch X-axis and Y-axis and
get row-representation of frequencies?
One more question, can I define the step of each axises
for the histogram?
Thanks so much!
Donghui
2006 Apr 21
3
Sorting Search results
I tried sorting the search results in Ferret::Index::Index#search and
what I found was that the sort is applied not to the whole search but to
the returned results.
Suppose I have these results:
Text - Num
foo - 2
bar - 3
far - 4
boo - 1
If I limit the search to the first two and sort by num I get:
foo - 2
bar - 3
while I think the natural behaviour would be:
boo - 1
foo - 2
Is this
2006 Sep 15
1
Custom analyzer not invoked?
Hello,
I''m trying to define my own analyzer by doing something like:
#-----------------------------------------------------
require ''ferret''
include Ferret
class MyAnalyzer < Analysis::Analyzer
def token_stream(field, str)
# Display results of analysis
puts ''Analyzing: field:%s str:%s'' % [field, str]
t =
2007 Mar 21
4
Cannot delete for id of type Array
Hello list,
I have a little weird error when deleting documents from the index.
I''m using the following code.
ferret_index = Ferret::Index::Index.new(:path => FERRET_INDEX_PATH)
query = Ferret::Search::TermQuery.new(:fk_file_id, "#{_fk_file_id}")
ferret_index.search_each(query) do | id |
ferret_index.delete(id)
end
And I get the following error
Cannot delete for id of
2006 Sep 22
2
Searching untokenized fields
Hi ..
I tried to exclude certain objects from my search, by adding appropriate
term queries ..
i = Ferret::Index::Index.new
i.field_infos.add_field(:type, :index => :untokenized, :term_vector => :no)
i << {:type => "Movie", :name => "Indiana" }
i << {:type => "Movie", :name => "Forrest" }
i << {:type =>
2007 Apr 09
5
highlight crashes
I am trying to use highlight, but I am getting this kind of thing:
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:197:in
`highlight'': IO Error occured at <except.c>:93 in xraise (IOError)
Error occured in index.c:1222 - lazy_df_get_bytes
len = -5, but should be greater than 0
from
2005 Dec 14
2
undefined method `add'' for Ferret::Search::BooleanQuery
Up to now in my ferret development I have been using simple
single-word strings as my search queries. I just now am trying to
increase the complexity of my queries. When I was passing a single
word with no spaces in my index searches, like so:
count = index.search_each(''testing'') do |d, s|
...
end
everything worked fine. But now when I do something like this:
count =