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

73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2008-09-10 13:27
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
28c237c0c414b644082bfcde4e42b309?d=identicon&s=25 John Leach (Guest)
on 2008-09-10 15:35
(Received via mailing list)
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"
>
<snip>
> 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
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2008-09-10 16:14
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
2a321daf565791ad30ac5ee945abf59a?d=identicon&s=25 Izidor Jerebic (Guest)
on 2008-09-10 20:11
(Received via mailing list)
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
This topic is locked and can not be replied to.