|
Re: Stem Analyzer: msg#00037lang.ruby.ferret.general
On 07.12.2006, at 06:27, Raymond O'connor wrote: > Well, you bring up another question I had. I was using a similar line > as yours above to call the stem analyzer and I always would get a > parse > error. I even get a parse error when I paste your line in. I'm > pretty > new to ruby, and I'm sure its something obvious but I can't get rid of > the parse error without removing the hash ticks such as > acts_as_ferret :fields => ["id", "name", "body"], :analyzer => > MyFunkyStemAnalyzer > When I do that, AAF never seems to call my analyzer. So I ended up > editing the AAF code and setting the analyzer option inside there > and it > worked except I get the whole problem I stated above. This is the method signature as of the latest AAF rdoc: acts_as_ferret(options={}, ferret_options={}) It expects two hashes, defaulting to empty hashes if no arguments are supplied. In Ruby you can omit the parentheses for a method call and the curly braces for a hash argument if it is the last argument. A method with the signature my_method(options = {}) may be used in the following ways: my_method my_method({:key => "value"}) my_method(:key => "value") my_method {:key => "value"} my_method :key => "value" So the following call is supposed to work acts_as_ferret {:fields => ["id", "name", "body"]}, {:analyzer => MyFunkyStemAnalyzer} You could try parentheses acts_as_ferret({:fields => ["id", "name", "body"]}, {:analyzer => MyFunkyStemAnalyzer}) which should work in any case since it is the most explicit form. If you still get a parse error, you might want to post your actual code and the error message you get. HTH Andy |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | crash on repeated search: 00037, Caleb Clausen |
|---|---|
| Next by Date: | Re: crash on repeated search: 00037, Andreas Korth |
| Previous by Thread: | Re: Stem Analyzeri: 00037, Raymond O'connor |
| Next by Thread: | Re: Stem Analyzer: 00037, Raymond O'connor |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | Mail Home | sitemap | FAQ | advertise |