Displaying 20 results from an estimated 30000 matches similar to: "Ferret - sorting results by score"
2008 May 09
1
Searcher Explain
Hi,
I am unable to use the Searcher''s explain method. Anytime I call it, I get
Segmentation Faults and it kills the process I have running my Rails site.
Has anyone else had this problem? Here is some code I am trying to use it
in...
search = Search.create(:query => query)
@quotations = []
searcher = Ferret::Search::Searcher.new("index") # FerretConfig::INDEX
bq =
2006 Sep 25
0
Odd indexing issue
Hey Dave,
I just contributed $100 to the ferret donation box. My project is
earning no money yet (but hopefully will), for now I hope this helps you
out and covers me for asking stupid questions ;).
To get a distance sorted output, I am passing an array of the id field
from a ferret search through to mysql in a custom select statement.
SELECT ... id IN (#{ids.join(",")})
This has
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 =
2006 Jul 07
4
Help installing Ferret
http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails
I followed everything here but at the last I get when loading page
get_results
Can only handle a String or a Query.
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/models/result.rb:27:in `search_each''
#{RAILS_ROOT}/app/models/result.rb:27:in `search_index''
2007 Apr 13
5
[Ferret] Serious memory leak on Joyent / TextDrive / Solaris
There is serious memory leak bug in ferret. I''m having this error on
TextDrive Container (aka. Joyent Accelerators) OpenSolaris with Ferret
0.11.4
It happens while searching for some terms with accented or special
characters.
This makes ferret to allocate lots of memory (usually reaching 3+ GB)
and failing if another query like this is executed.
Any ideas on that, could this be locale
2007 Jan 05
3
Confused about Search Results
Hi everyone,
I''m pretty new to Lucene and Ferret, so I feel that this is most likely
myself not completely understanding the correct way to do this. I haved
indexed ~2200 text files (of various sizes), and I am now running
searches on the index to get a feel for Lucene and Ferret.
In my first program, which is using Lucene I search for ''influenza'' and
get the
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 =
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 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 =
2006 May 05
3
Sorting by score
I''m trying to sort by score but it seems like SortField::SortType::SCORE
is 0 instead of a SortType. A test case is attached. Without the C
extensions the test passes, so I guess it''s a bug in them. Should I be
using it without the extensions? Because if that''s the case I have some
other bugs to report.
Greetings,
Pedro C?rte-Real
-------------- next part
2006 Jan 19
2
Simple Ferret Questions
I am trying to use Ferret for searching for users based on first and last name.
In my index, I am adding the first_name, last_name, and a full_name
which is basically "#{first_name} #{last_name}".
I am searching the index using something like the following query:
INDEX.search_each(%Q/first_name:#{query}* OR last_name:#{query}* OR
full_name:#{query}*/) do |doc, score|
The problem I am
2006 Oct 16
10
Sorting by score
Hi I think this is a very easy question but here goes:
I want to sort my results by a boolean field and then by score, I
thought this would be a default configuration but apparently not.
sort_fields = []
sort_fields << Ferret::Search::SortField.new(:sponsored, :reverse =>
:true)
that is my current code, how do iu alter it so that the results are then
sorted by highest score first?
2007 May 02
1
MultiSearcher Results Question
If searching multiple indexes with a single searcher is there anyway to
identify which index a resulting doc is stored in?
i1 = Ferret::I.new
i2 = Ferret::I.new
i1 << {:id=>1,:text=>"random stuff"}
i1.commit
reader =
Ferret::Index::IndexReader.new([i1.options[:dir],i2.options[:dir]])
searcher = Ferret::Index::IndexSearcher.new(reader)
query =
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''
2007 Jul 03
4
problems with acts_as_ferret
Hi,
I have i am trying to add a search feature to a ruby on rails blog, so
ive decided to use ferret. So far i have had quite a few problems with
it, from following a few tutorials i didnt really understand... i am at
the point where i can make a search and it returns the score of the
result. I want it to also show the title of the post and i think i have
implemented it correctly but it
2006 Jun 25
1
Sorting ferret results by column
I have the acts_as_ferret plugin installed. Everything searches great,
but I would like to limit the results (i.e. by ''end_date'') and sort them
(by ''end_date''). ''end_date'' is a valid column in my "posts" table.
Here''s the code I have already:
@posts = Post.find_by_contents(params[:query])
params[:query] comes from a form. I
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 =
2006 Sep 22
1
Query Objects vs. Query Strings
Hi ..
I tried to build some query objects to get some documents from my
index.. without success.. Is something wrong here?
q = Ferret::Search::BooleanQuery.new
q1 = Ferret::Search::TermQuery.new(:type, "movie")
q2 = Ferret::Search::TermQuery.new(:name, "Indiana")
q.add_query(q1, :should)
q.add_query(q2, :should)
Indexer.index.search_each(q) do |doc, score| puts doc end
0
2007 May 22
1
Bug in Ferret::Search::SortField::SCORE ??
i have been trying to get this to work for a while now. my controller
is
sort = [ Ferret::Search::SortField::SCORE_REV ]
@results = Record.multi_search(params[:search_terms], [ Link, Post,
Event ], {:limit => :all, :sort => sort })
and in my view i just render a conglomeration of the appropriate
partials for each model. it seems that no matter what i do, i can''t get
the
2006 Oct 31
3
No search results using Searcher
I just started using Ferret and I successfully indexed some documents. I
can search this index using the following code:
index = Index::Index.new(:path => path)
index.search_each("something") do |doc, score|
print "##{doc} #{index[doc][''url'']} - #{score}"
print "\n"
end
However, when I try to use Search::Searcher and QueryParser