Find results that some (but not all) of search term words

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

On Wed, 2008-09-10 at 13:27 +0200, Max W. 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

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

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