Skip to content
Tags

Thinking Sphinx. See and Learn

December 29, 2010
ruby-1.9.2-p0 :012 > Resource.search("God, gagan", :match_mode => :any).count

=> 20

ruby-1.9.2-p0 :013 > Resource.search("God, gagan", :match_mode => :all).count

=> 0

ruby-1.9.2-p0 :021 > r = Resource.search("anxiety", :match_mode => :any, :rank_mode => :bm25)

 

ruby-1.9.2-p0 :022 > r.each_with_weighting do |e, w|

ruby-1.9.2-p0 :023 >     puts w

ruby-1.9.2-p0 :024?>   end

4

4

2

2

2

2

2

2

2

2

1

1

1

1

1

1

1

1

1

1

 

ruby-1.9.2-p0 :021 > r = Resource.search("anxiety, anxiety", :match_mode => :any, :rank_mode => :bm25)

 

 

ruby-1.9.2-p0 :018 > r.each_with_weighting do |e, w|

ruby-1.9.2-p0 :019 >     puts w

ruby-1.9.2-p0 :020?>   end

8

8

4

4

4

4

4

4

4

4

2

2

2

2

2

2

2

2

2

2

 

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: