From toastkid.williams at gmail.com Wed Sep 10 07:27:14 2008 From: toastkid.williams at gmail.com (Max Williams) Date: Wed, 10 Sep 2008 13:27:14 +0200 Subject: [Ferret-talk] Find results that some (but not all) of search term words Message-ID: <14749d7ead34e3a601c4f7ba5eb8b6c5@ruby-forum.com> That title's not great sorry. Anyway - let's say i've indexed 3 records that have these name fields: St Joseph's Primary St Mark' Primary St Mary's Secondary School And my search term is "St Joseph's Primary School" How can i do my search so that "St Joseph's Primary" is the top result? I tried splitting the name with 'OR', like this (i'm using acts_as_ferret in rails) School.find_with_ferret(school.name.gsub(" OR ")) But this returned me all of the records (no problem), but with St Joseph's Primary not being the top result (not good enough). Since my required record is the closest match (intuitively) i feel like i should be able to get it as the top result. Can anyone help? Thanks max -- Posted via http://www.ruby-forum.com/. From john at johnleach.co.uk Wed Sep 10 09:35:14 2008 From: john at johnleach.co.uk (John Leach) Date: Wed, 10 Sep 2008 14:35:14 +0100 Subject: [Ferret-talk] Find results that some (but not all) of search term words In-Reply-To: <14749d7ead34e3a601c4f7ba5eb8b6c5@ruby-forum.com> References: <14749d7ead34e3a601c4f7ba5eb8b6c5@ruby-forum.com> Message-ID: <1221053714.5888.22.camel@dogen.thepride.> On Wed, 2008-09-10 at 13:27 +0200, Max Williams wrote: > That title's not great sorry. Anyway - let's say i've indexed 3 records > that have these name fields: > > St Joseph's Primary > St Mark' Primary > St Mary's Secondary School > > And my search term is "St Joseph's Primary School" > > But this returned me all of the records (no problem), but with St > Joseph's Primary not being the top result (not good enough). Since my > required record is the closest match (intuitively) i feel like i should > be able to get it as the top result. Hi Max, what is the order of the results you get? I'm suspecting this could be due to the behaviour of the tokenizer, the other results might be a clue. You could also browse the index using ferret-browser to see how it's been tokenized. John. -- http://johnleach.co.uk From john at johnleach.co.uk Wed Sep 10 09:43:20 2008 From: john at johnleach.co.uk (John Leach) Date: Wed, 10 Sep 2008 14:43:20 +0100 Subject: [Ferret-talk] SortField via Drb Message-ID: <1221054200.5888.30.camel@dogen.thepride.> Hi, we need to use an SortField object so we can specify the column type: sf_title = SortField.new(:title, :type => :string) Except SortField objects don't appear to be marshalled properly across DRb. Luckily you can specify the sort field and reverse option as free form text to the query, but you apparently can't specify the type. Possible solutions: * Maybe you can specify the type. Does anyone know how? * Maybe SortField can be made to marshall. Does anyone know how, or where best to start adding this if necessary? * Maybe we can add this support to Ferret. Doesn't anyone have any clues where to start? We don't mind doing some C coding :) Thanks in advance! John. -- http://johnleach.co.uk From kraemer at webit.de Wed Sep 10 10:07:30 2008 From: kraemer at webit.de (=?ISO-8859-1?Q?Jens_Kr=E4mer?=) Date: Wed, 10 Sep 2008 16:07:30 +0200 Subject: [Ferret-talk] SortField via Drb In-Reply-To: <1221054200.5888.30.camel@dogen.thepride.> References: <1221054200.5888.30.camel@dogen.thepride.> Message-ID: Hi! Do you use aaf? In this case it should work (tm), since aaf has support for this built in, see http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/ferret_extensions.rb If not, feel free to take the marshalling code to monkey patch your Ferret - no C coding necessary ;) Cheers, Jens On 10.09.2008, at 15:43, John Leach wrote: > Hi, > > we need to use an SortField object so we can specify the column type: > > sf_title = SortField.new(:title, :type => :string) > > Except SortField objects don't appear to be marshalled properly across > DRb. > > Luckily you can specify the sort field and reverse option as free form > text to the query, but you apparently can't specify the type. > > Possible solutions: > > * Maybe you can specify the type. Does anyone know how? > > * Maybe SortField can be made to marshall. Does anyone know how, or > where best to start adding this if necessary? > > * Maybe we can add this support to Ferret. Doesn't anyone have any > clues where to start? We don't mind doing some C coding :) > > Thanks in advance! > > John. > -- > http://johnleach.co.uk > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49351467660 | Telefax +493514676666 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold From toastkid.williams at gmail.com Wed Sep 10 10:14:37 2008 From: toastkid.williams at gmail.com (Max Williams) Date: Wed, 10 Sep 2008 16:14:37 +0200 Subject: [Ferret-talk] =?utf-8?q?Find_results_that_some_=28but_not_all=29_?= =?utf-8?q?of_search=09term_words?= In-Reply-To: <1221053714.5888.22.camel@dogen.thepride.> References: <14749d7ead34e3a601c4f7ba5eb8b6c5@ruby-forum.com> <1221053714.5888.22.camel@dogen.thepride.> Message-ID: Hi John I just tried it (ORing the words) again with some real records to give you an example, and it worked, embarrassingly (for me). It's that verdammt observer effect, when something start working the moment you get someone else to look at it. I guess i had some kind of brainwrong when trying it earlier. thanks a lot anyway max -- Posted via http://www.ruby-forum.com/. From john at johnleach.co.uk Wed Sep 10 11:34:51 2008 From: john at johnleach.co.uk (John Leach) Date: Wed, 10 Sep 2008 16:34:51 +0100 Subject: [Ferret-talk] SortField via Drb In-Reply-To: References: <1221054200.5888.30.camel@dogen.thepride.> Message-ID: <1221060891.5888.38.camel@dogen.thepride.> On Wed, 2008-09-10 at 16:07 +0200, Jens Kr?mer wrote: > Hi! > > Do you use aaf? In this case it should work (tm), since aaf has > support for this built in We certainly do use aaf. I'll take a look why this isn't working for us. Thanks Jens, you're awesome as always :) John. -- http://johnleach.co.uk From ij.rubylist at gmail.com Wed Sep 10 14:11:21 2008 From: ij.rubylist at gmail.com (Izidor Jerebic) Date: Wed, 10 Sep 2008 20:11:21 +0200 Subject: [Ferret-talk] Find results that some (but not all) of search term words In-Reply-To: References: <14749d7ead34e3a601c4f7ba5eb8b6c5@ruby-forum.com> <1221053714.5888.22.camel@dogen.thepride.> Message-ID: Hello, I have just come across the same situation at our index. Search for: black house (without quotes) and several items with multiple occurrence of 'black' but without any 'house' come before items with one occurrence of 'black' and one 'house'. It seems that ferret ranks higher items with multiple single term occurrences than items which have all terms but each term only once. Is this true? How could this be changed, without changing query - some indexing option maybe? izidor On 10.9.2008, at 16:14, Max Williams wrote: > Hi John > > I just tried it (ORing the words) again with some real records to give > you an example, and it worked, embarrassingly (for me). It's that > verdammt observer effect, when something start working the moment you > get someone else to look at it. > > I guess i had some kind of brainwrong when trying it earlier. > > thanks a lot anyway > max > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk From lyesjob at gmail.com Sun Sep 28 06:20:32 2008 From: lyesjob at gmail.com (Lyes Amazouz) Date: Sun, 28 Sep 2008 11:20:32 +0100 Subject: [Ferret-talk] using tokenizers ? Message-ID: <60d886530809280320n1659a6c4pa63e2480a26dd882@mail.gmail.com> Hi lis I using Ferret to index some files for a specific usage. I want to know how can I set a tokenizer for some of my index fields and if I can choose a different tokenizer for each field. For example: If in my document I have two fields :F1 and :F2. What I have to do if I want that the field :F1 will be tokenized with a StandardTokenizer and :F2 with the WhiteSpaceTokenizer?? thank you -- =========== | Lyes Amazouz | USTHB, Algiers =========== -------------- next part -------------- An HTML attachment was scrubbed... URL: