Displaying 20 results from an estimated 4000 matches similar to: "How to do case-sensitive searches"
2007 Sep 07
5
Custom Analyser .. where to put it ??
Hi,
I m trying to use a custom analyser to add my french stop words... i m
reading the tutorial at :
http://projects.jkraemer.net/acts_as_ferret/wiki/AdvancedUsage
My problem is that i ve no idea where to put my custom Analyser class
like :
class GermanStemmingAnalyzer < Ferret::Analysis::Analyzer
include Ferret::Analysis
def initialize(stop_words = FULL_GERMAN_STOP_WORDS)
2007 Mar 28
6
trouble with PerFieldAnalyzer
I''m having trouble with PerFieldAnalyzer (ferret version 0.10.14).
Script:
require ''rubygems''
require ''ferret''
require ''pp''
include Ferret::Analysis
include Ferret::Index
class TestAnalyzer
def token_stream field, input
pp field
pp input
LetterTokenizer.new(input)
end
end
pfa =
2006 Aug 29
7
uninitialized constant UNTOKENIZED
I''m getting "uninitialized constant UNTOKENIZED" when I try to do
something like the following:
class Url < ActiveRecord::Base
acts_as_ferret :fields => {''name'' => {},
''description'' => {},
''url'' => {:index =>
Ferret::Document::Field::Index::UNTOKENIZED},
2007 Apr 08
3
How to make custom TokenFilter?
In the O''reilly Ferret short cuts, I found very useful example for me.
It explains how to make custom Tokenizer.
But that book doesn''t explain how to make custom Filter.
(especially, how to implement the #text=() method)
I''m a newbee and I don''t understand how do I create my own custom
Filter.
Are there some good source code examples??
--
Posted via
2006 Nov 01
8
aaf and stop words; query parser
I''ve been trying to implement acts_as_ferret in my latest project and ran into a snag. If I do a search for ''auditor state'' then the search works perfectly. If I include a stop word, as in ''auditor of state'', then I get no results. I''d prefer not to set stop words to nil and index everything.
The solution, that I have yet to attempt, is to use
2007 Jan 11
5
ASF: cannot determine document number from primary key
I''m getting this exception from acts_as_ferret:
A RuntimeError occurred in search#similar:
cannot determine document number from primary key:
#<MyClass:0x9feba20>
[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:132:in
`document_number''
As a result of this call:
object.more_like_this
The relevant backtrace:
2006 Aug 30
7
AAF Sorting by date - what am I doing wrong?
I''m trying to sort my search results by Date, in descending order. I''ve
done quite a bit of reading through the forums here, and I''ve tried two
different suggestions.
This just returns results in the same order as a search without a sort:
sort_fields = []
sort_fields <<
Ferret::Search::SortField.new("ferret_created_at",:reverse => :true)
2005 Dec 14
5
Query question
I have an index in which I want different records to be accessible to
different users. I think I can do this by adding a "users" field to
each record in the index and narrow down my queries to only those
records matching the current user''s userid. I have the userids
separated by commas. What would be the right way to query for a
certain user? I have to make sure that I
2006 Dec 28
13
Sorting/Ordering Search Results
Hello All,
I am having an issue with AAF and sorting results of a search. Right
now, I have results being split onto pages of 10. The results are being
sorted alphabetically, but not across multiple pages - it''s just sorting
the 10 it pulls down on each page. I noticed another post from April
regarding this same issue (http://www.ruby-forum.com/topic/62993#66934)
where the issue was
2006 Oct 19
2
How to deal with accentuated chars in 0.10.8?
I''m startin to use Ferret and acts_as_ferret.
I need to use something like EuropeanAnalyzer
(http://olivier.liquid-concept.com/fr/pages/2006_acts_as_ferret_accentuated_chars).
By example, if the user search by "gonzalez" you can find documents taht
contents the term "gonz?lez" (gonzález)
The EuropeanAnalyzer is based on Ferret::Analysis::TokenFilter,
2007 Mar 06
1
case-sensitivity of analyzer
Is there anything about this analyzer that says "case-sensitive" to you?
module Ferret::Analysis
class StemmingAnalyzer
def token_stream(field, text)
StemFilter.new(StandardTokenizer.new(text))
end
end
end
Just wondering how I can force my index to be case-insensitive.
Thanks,
-Adam
--
Posted via http://www.ruby-forum.com/.
2006 Aug 30
7
Hyphens
Hi there,
I''m working with some legacy data where customer phone numbers are
stored with hyphens between the area code, exchange, and number (e.g.
555-555-5555). Is this the best way to store a phone number? Perhaps
not, but it''s the way they were being stored, so I have to work with
this format.
Right, so when I save a record the log tells me acts_as_ferret indexed
the
2006 Aug 20
7
missing terms in index causing search errors
I am unable to find results for models when one or more of the terms are
not being indexed.
Lets suppose I index a User on the phrase "Ruby on Rails." If I then
search using User.find_by_contents("Ruby on Rails") I get no results,
since "or" is a common term and does not get indexed. Of course,
User.find_by_contents("Ruby Rails") works just fine.
I
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
2006 Jul 31
16
Sorting performance
I''m using acts_as_ferret to index one of my rails models. Right after I
start the app the first request that orders by some ferret field will
take very long. Subsequent ones seem to be fast. I guess some caching is
going on. Any tips on solving this?
Pedro.
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/.
2007 Jun 08
13
Errror on update after Model.rebuild_index
Hi
I use Ferret 0.11.4 and the latest stabel version of the acts_as_ferret
plugin.
To the issue. if I do Model.rebuild_index and after that try to update
one of my objects of that Model I get:
File Not Found Error occured at <except.c>:117 in xpop_context
Error occured in fs_store.c:329 - fs_open_input
tried to open
2007 Jul 25
17
DRb not starting
Hi,
I have my Model as follows:
class Mutation < ActiveRecord::Base
acts_as_ferret ({:fields => {:description=>{},
:product_id=>{:index => :untokenized},
:product_description=>{},
:product_label_description=>{},
:product_label_free=>{},
:product_product_id_supplier=>{},
:product_description_supplier=>{},
:supplier_description=>{},
:pub_date_sort
2007 Jul 13
8
More sorting problems with untokenized index
I''m having problems sorting on untokenized fields. I have one field that
sorts fine, but there are others that seem to sort on a different field.
Here''s the index description:
acts_as_ferret
:remote=>true,:fields=>{:name=>{:boost=>2},:name_for_sort=>{:index =>
:untokenized},
:city=>{:boost=>2}, :city_for_sort=>{:index=>:untokenized},
2006 Sep 18
16
Dynamic fields and AAF
Hi,
I have a model which has properties, these are your standard name/value
pairs, but also have attributes that affect how I want to store them in
ferret. I was using 0.9.5 with 0.2 of aaf, which seemed fine, I just
copied and pasted (yes, I know, ick) the to_doc method and added code to
iterate though the properties that that model had, and add relavent
fields to the document.
It seems