Forum: Ferret Proximity searching in rdig ferret

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.
44896977650aef424270590e60b39964?d=identicon&s=25 Ed -- (epo001)
on 2007-02-15 14:06
Lucene has a syntax "foo bar"~10 for finding foo within 10 words of bar.

Does ferret support this feature? (the ~ is used for fuzzy queries) Does
rdig?

This could be a deal breaker for me 'cos I really need proximity
searches
44896977650aef424270590e60b39964?d=identicon&s=25 Ed -- (epo001)
on 2007-02-15 14:10
Of course it works - stupid boy!

Ed Ed wrote:
> Lucene has a syntax "foo bar"~10 for finding foo within 10 words of bar.
>
> Does ferret support this feature? (the ~ is used for fuzzy queries) Does
> rdig?
>
> This could be a deal breaker for me 'cos I really need proximity
> searches
D148c5959e4eccc97f33244f1c5396e9?d=identicon&s=25 Benjamin Krause (Guest)
on 2007-02-15 15:03
(Received via mailing list)
> Lucene has a syntax "foo bar"~10 for finding foo within 10 words of bar.

sure .. take a look at this (take from the API):

--snip--
  query = SpanNearQuery.new(:slop => 2)
  query << SpanTermQuery.new(:field, "quick")
  query << SpanTermQuery.new(:field, "brown")
  query << SpanTermQuery.new(:field, "fox")

  # matches => "quick brown speckled sleepy fox"
                               |______2______^
  # matches => "quick brown speckled fox"
                                |__1__^
  # matches => "brown quick _____ fox"
                  ^_____2_____|

A SpanNearQuery is like a combination between a PhraseQuery and a
BooleanQuery. It matches sub-SpanQueries which are added as clauses but
those clauses must occur within a slop edit distance of eachother.

http://ferret.davebalmain.com/api/classes/Ferret/S...
--snip--

and even better, you can force the order of the words.. the above
example
doesn't care about the order of the words, but if the order is important
to you, you can build queries that will search for terms in order and a
maximal distance between the words..

look at http://blog.omdb-beta.org/2007/1/16/brad_pitt


Ben
D148c5959e4eccc97f33244f1c5396e9?d=identicon&s=25 Benjamin Krause (Guest)
on 2007-02-15 15:13
(Received via mailing list)
> Of course it works - stupid boy!

it's okay to doubt ferret.. sooner or later you will be convinced ;)

happy ferret'ing ..

Ben
This topic is locked and can not be replied to.