Forum: Ferret partial term query by default

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bryan W. (Guest)
on 2007-07-20 01:34
My customers seem to expect that the world of search is dictated by
Google.  As such they expect all queries except phrase queries to
include partial term hits.  In other words, searching on "test" also
returns "testing".

Is there a quick option to enable this or anyway more elegant than
gsub'ing the query to add asterisks around each term (except those in
phrases of course)?

Thanks,

-bryan
Jens K. (Guest)
on 2007-07-20 12:29
(Received via mailing list)
On Thu, Jul 19, 2007 at 11:34:19PM +0200, Bryan Wilkerson wrote:
>
> My customers seem to expect that the world of search is dictated by
> Google.  As such they expect all queries except phrase queries to
> include partial term hits.  In other words, searching on "test" also
> returns "testing".

With a Stemmer included in your analyzer 'testing' would actually be
indexed as 'test' and therefore get found with a query for 'test'.
Of course this won't help if you expect to find 'tree' when searching
for 'tr', in this case you'll have to build wildcard queries from the
terms of the query.

Here's an example for a custom analyzer using a StemFilter:

http://www.ruby-forum.com/topic/90606#new


Jens


--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
This topic is locked and can not be replied to.