Skip to content

Commit 2dfa1e8

Browse files
committed
Simplified example [skip ci]
1 parent b33483e commit 2dfa1e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ class Document < ApplicationRecord
463463
has_neighbors :embedding
464464

465465
scope :keyword_search, ->(query) {
466-
where("to_tsvector('english', content) @@ plainto_tsquery('english', ?)", query)
467-
.order(Arel.sql("ts_rank_cd(to_tsvector('english', content), plainto_tsquery('english', ?)) DESC", query))
466+
where("to_tsvector(content) @@ plainto_tsquery(?)", query)
467+
.order(Arel.sql("ts_rank_cd(to_tsvector(content), plainto_tsquery(?)) DESC", query))
468468
}
469469
end
470470
```

Diff for: examples/hybrid/example.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Document < ActiveRecord::Base
1717
has_neighbors :embedding
1818

1919
scope :keyword_search, ->(query) {
20-
where("to_tsvector('english', content) @@ plainto_tsquery('english', ?)", query)
21-
.order(Arel.sql("ts_rank_cd(to_tsvector('english', content), plainto_tsquery('english', ?)) DESC", query))
20+
where("to_tsvector(content) @@ plainto_tsquery(?)", query)
21+
.order(Arel.sql("ts_rank_cd(to_tsvector(content), plainto_tsquery(?)) DESC", query))
2222
}
2323
end
2424

0 commit comments

Comments
 (0)