Displaying 20 results from an estimated 110 matches similar to: "Extending/Modifying QueryParser"
2007 Nov 09
2
Problem with stemming and AAF
I''m sure I''m missing something completely obvious here, so I hope
someone can point me in the right direction!
I''ve implemented a basic search with AAF, which works as expected; I''m
running a ferret drb server, and using will_paginate to page results.
The code in my search_controller.rb:
search_text = params[:query] || " "
@products =
2006 Nov 25
5
Metaphone analysis
Not sure how much this will interest people but I don''t have a blog so I''m
posting something I threw together today cause I think it might be useful.
In what little free time I have I''ve been wanting to put together a
Rails/Ferret based restful dictionary. So I finally got a chance to get
started today so the first thing I wanted to do was implement a metaphone
2006 Oct 23
2
Trouble with custom Analyzer
Hi!
I wanted to build my own custom Analyzer like so:
class Analyzer < Ferret::Analysis::Analyzer
include Ferret::Analysis
def initialize(stop_words = ENGLISH_STOP_WORDS)
@stop_words = stop_words
end
def token_stream(field, string)
StopFilter.new(LetterTokenizer.new(string, true), @stop_words)
end
end
As one can easily spot, I essentially want
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)
2006 Dec 08
4
Using custom stem analyzer giving mongrel errors
I''m using the custom stem analyzer:
require ''rubygems''
require ''ferret''
include Ferret
module Ferret::Analysis
class FerretAnalyzer
def initialize(stop_words = FULL_ENGLISH_STOP_WORDS)
@stop_words = stop_words
end
def token_stream(field, text)
StemFilter.new(StopFilter.new(LowerCaseFilter.new(StandardTokenizer.new(text)),
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
2008 May 12
1
Using StemFilter with PhraseQuery
Hi,
I''m having difficulty getting the StemFilter and PhraseQuery to work
properly together. When I use a StemFilter with a PhraseQuery, searches only
work if the phrase consists of stems. For example, the search phrase
"reduces health care" will not work but the phrase "reduce health care" will
work even though the exact text "reduces health care" is
2007 Aug 20
2
can''t stop stop_words
I have looked at the documentation and done some searching, but I can''t
seem to stop the STOP_WORDS from cutting out common words. I am using
acts_as_ferret and I have add the following to my code:
STOP_WORDS = []
acts_as_ferret({ :fields => { :name => { :boost
=> 10 },
:project_client_company_id => { :boost
=> 0
2006 Apr 20
1
Creating my own analyzer
I created this analyzer:
class DescriptionAnalyzer < Ferret::Analysis::Analyzer
def token_stream(field, string)
if field == "code"
return CodeTokenStream.new(string)
else
return Ferret::Analysis::Analyzer.new.token_stream(field,string)
end
end
end
and created an IndexWriter with it:
Ferret::Index::IndexWriter.new(get_index_path,
2006 Oct 24
2
Problem with stop words
I am seeing trouble with searches for ''you'' not returning anything. It
appears that ''you'' is a stop word to the standard analyzer:
require ''rubygems''
require ''ferret''
index = Ferret::I.new(:or_default => false)
index << ''you''
puts index.search(''you'')
returns
2020 Nov 04
1
Eliminar números de texto
Buenas,
Estoy analizando texto en R y no encuentro cómo eliminar los números y
símbolos del texto como ",", "%", etc.
Estoy pasando este código, text_data es donde está el texto en la variable
"text".
tidy_data <- text_data%>%
unnest_tokens(word, text)%>%
anti_join(stop_words)
¿Cómo podría añadirse a ese código?
Muchas gracias
2007 Aug 03
0
StandardTokenizer Doesn''t Support token_stream method
According to the Analyzer doc and the StandardTokenizer doc:
http://ferret.davebalmain.com/api/classes/Ferret/Analysis/Analyzer.html
http://ferret.davebalmain.com/api/classes/Ferret/Analysis/StandardTokenizer.html
I ought to be able to construct a StandardTokenizer like this:
t = StandardTokenizer.new( true) # true to downcase tokens
and then later:
stream = token_stream(
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/.
2007 Mar 22
0
Url searching ?
Hi all :)
I have many objects with a url field, of course containing standards
urls...
I''m trying to match them but i actually got problems with that.
Here''s a little code of what i would like to achieve:
require ''rubygems''
require ''ferret''
require ''ftools''
class TestAnalyzer
def token_stream(field, str)
ts =
2006 Nov 13
1
Stemming, stop words, acts_as_ferret
I''d like to get the following behavior:
1. Stemming. The search is on a database of summaries of California legal
cases. Things like a search for "thermal image" needs to hit "thermal
imaging."
2. Stop words. Searches for "failing to instruct the jury" should come up
with hits on a search for "fail to instruct."
3. Case-insensitive.
What I
2006 Oct 20
0
Ferret 0.10.13 released
Hi Folks,
I''ve just release Ferret 0.10.13 (skip 0.10.12, it was a bad build).
There are two interesting additions to this release. You can now
access the Filter#bits method of the built in filters so you can can
use them in your own code, possibly within your own custom filters.
For example you could implement a custom filter like so:
class MultiFilter < Hash
def
2007 Jan 21
2
A few questions: Tweaking StemFilter, indexes, ...
Hello all,
I am new to the list, but I have been using ferret for a little bit
already. I would first like to thank Dave for all his work on ferret.
I had a few questions that I haven''t been able to figure out after
messing around with ferret and going through the documentation.
StemFilter ------
I am trying to improve the quality of my searches in context of the
content of my
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 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 May 03
2
Custom analyzer weirdness with 0.11.3
Hi-
I was previously using 0.11.4, and I wrote my own analyzer. Everything
worked fine.
When I took the system to production, 0.11.4 starting failing updating
the index, complaining that files were missing. The failure always
happened on the same model document, and was completely reproducible.
This failure looked a lot like the one described at
http://www.ruby-forum.com/topic/104145.
I