Displaying 20 results from an estimated 40000 matches similar to: "Constructing a query from an object"
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 Jan 05
2
ActiveRecord callbacks not happening
Hi,
I have a model class like so:
class Candidate < ActiveRecord::Base
validates_presence_of :name
@@index = FerretConfig::INDEX
def self.after_destroy
puts "Ferret: after_destroy called"
@@index.query_delete("+id:#{self.id} +ferret_class:#{self.class.name}")
optimize_index
end
end
But when I delete a record, the after_destroy is never called.
2006 Jan 02
3
Multiple indexes?
Hi,
I''m indexing records from different database tables and they have
identical column names in many cases. Does this mean I have to create
different indexes for each table?
TIA,
Vamsee.
2005 Dec 31
2
Some newbie questions
Hi all,
I''m newly discovering Ferret, and just did a crash course on Lucene to
(I get the concepts behind it). But I''m have a few doubts:
1. What is the ''recommended'' way of integrating Ferret into my app now?
The gem version or the plugin?
2. Where do I checkout the plugin from? Do I just copy the version on
the wiki?
Those apart, Ferret is really
2006 Jan 05
6
Problems with Ferret in RForum
Hi,
I have been using Ferret on ruby-forum.com for a few days. While the
searching works with reasonable performance, there are a lot of problems
related to indexing. Sometimes the process hangs with 100% CPU usage,
sometimes it leaves Lockfiles in the directory (causing other processes
to fail while one ist still working), sometimes it even crashes with a
segfault.
I''m going to
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
2005 Dec 18
1
assert_template fails?
Hi All,
I have a seemingly simple problem - but can''t figure out the problem. I
have a simple functional test like so:
def test_should_show_search_dropdown
get :index
assert_response :success
assert_template :search
end
Inspite of having search.rhtml in /app/views/layout, it fails with an error:
1) Error:
test_should_show_search_dropdown(SearchControllerTest):
2006 Jan 02
11
aligning Ferret''s IndexSearcher.search API with Lucene''s
Recently I''ve been revisiting some of my search code. With a greater
understanding of how Java Lucene implements its search methods, I
realized that one level of abstraction is not present in the Ferret
classes/methods. Here are the relevant method signatures:
Ferret''s search methods:
in Ferret::Index::Index:
search(query, options = {}) -> returns a TopDocs
2007 Sep 09
1
MultiTerm query segfault - remote denial of service
Hi ferreteers,
I came across a segfault in the query parser. It had already been
reported[1] and fixed[2], but it can lead to a denial of service.
If you use Ferret anywhere that you allow users to execute queries,
those users can crash your Ruby process with a specially crafted
query.
I''m sure you''re all using Monit or something for your Rails or drb
processes, so
2007 Apr 15
3
Massive difference in query times on OSX and Linux
I have a 1.7GB index with 440818 documents. Queries that take 0.23846
seconds on my MacBook pro take an indefinite period of time on a
Fedora Core 4 EC2 instance. Five minutes and counting...I''m using
Ferret 0.11.3. I don''t see any errors in the logs.
Has anyone ever seen anything like this?
2007 May 29
0
Query strings and stop words
Is there an option for filtering stop words out of the query string,
so that queries that contain stop words don''t return zero results? It
has been several years, but I think that when I was on a project that
was writing a search engine, we used to filter stop words both out of
the index and out of the query string, after it was parsed. This
allows a query like [cold and sinus] to
2006 Jun 27
2
Using QueryParser vs building my own query
Hello all
I finally caved in and decided I should build my own query instead of
relying on QueryParser to do the job for me, but I''ve hit a strange
problem..
Here''s how I build my query:
#Main query
query = Ferret::Search::BooleanQuery.new
#Build query to match types
typesquery = Ferret::Search::BooleanQuery.new
@selected_types.each{|type|
typesquery.add_query(
2007 Jul 11
4
Query with special characters crashes under Windows XP
Hi,
Index queries with special characters (e.g. German Umlauts but also
other European ones) make the Ruby process run for quite a long time and
crash finally.
I''m using Rails on Windows XP with Ferret 0.11.4_mswin_32.
I could isolate the problem in the following simple controller action
(so there''s no web browser form field involved):
def test
index = Ferret::I.new
index
2007 May 14
0
Ferret as an object database
Hi List and especially Dave,
I just happened to remember a discussion on the mailing list, that you
(Dave) are thinking and maybe even working on Ferret becoming kind of an
object database that fully circumvents the SQL-Store on occasions where this
might be appropriate (http://www.ruby-forum.com/topic/82086#142613).
I''m using ferret quite heavily at the moment for a private project of
2007 Mar 21
3
Score more if begins with query
Hi,
I need to score more on products, those names
begin with query, rather then just contain it.
I am not sure where to start research on that...
Any ideas?
Best regards,
Tom
--
Posted via http://www.ruby-forum.com/.
2006 Jul 24
0
error searching for a boolean query
Hey ..
i''m not sure if the trac is currently maintained, so i''ll post this here
as well, just to make sure :)
http://ferret.davebalmain.com/trac/ticket/94
i get a segfault on certain queries.. i guess thats a problem with the
query parser..
>> Indexer.index.search( "american~0.6 AND NOT type:Language" )
*** glibc detected *** double free or corruption
2006 Mar 08
1
indexing a document object fails
Hi,
I''m trying out the example (more or less) straight from the tutorial:
doc = Document.new
doc << Field.new("id", "a", Field::Store::NO,
Field::Index::UNTOKENIZED)
doc << Field.new("title", "b", Field::Store::YES, Field::Index::UNTOKENIZED)
doc << Field.new("data", "c",
2007 Apr 10
1
disable indexing for an object
Hi,
I have a project where the user adds content to the database, but before
it''s indexed they have to confirm it via email.
How can I disable indexing for just one particular object, and then
after confirmation let ferret know about it?
- Radu
--
Posted via http://www.ruby-forum.com/.
2007 Aug 18
0
range queries in phrases/spans?
Hi --
I''m developing a system that lets users associate arbitrary [key,
numeric value] pairs (among other forms of data) with "documents".
Question: is there any reasonable way to get Ferret to index and do
range queries over such beasts?
Since the keys are arbitrary and there are potentially more of them than
there are documents, I''d assume that adding a specific
2007 Jan 11
5
stop words in query
Hello all,
Quick question, I''m using AAF and the following custom analyzer:
class StemmedAnalyzer < Ferret::Analysis::Analyzer
include Ferret::Analysis
def initialize(stop_words = ENGLISH_STOP_WORDS)
@stop_words = stop_words
end
def token_stream(field, str)
StemFilter.new(StopFilter.new(LowerCaseFilter.new(StandardTokenizer.new(str)),
@stop_words))
end
However when