mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-07 14:03:41 +01:00
c14bae74d5
this commit is an attempt at building a search functionality using only the stuff provided by postgresql it is, unfortunately, painfully slow: PgSearch::Document Load (7869.1ms) SELECT "pg_search_documents".* FROM "pg_search_documents" INNER JOIN (SELECT "pg_search_documents"."id" AS pg_search_id, (ts_rank((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))), (to_tsquery('simple', ''' ' || 'awoo' || ' ''')), 0)) AS rank FROM "pg_search_documents" WHERE ((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))) @@ (to_tsquery('simple', ''' ' || 'awoo' || ' ''')))) AS pg_search_ce9b9dd18c5c0023f2116f ON "pg_search_documents"."id" = pg_search_ce9b9dd18c5c0023f2116f.pg_search_id ORDER BY pg_search_ce9b9dd18c5c0023f2116f.rank DESC, "pg_search_documents"."id" ASC LIMIT $1 [["LIMIT", 10]]
15 lines
433 B
Ruby
15 lines
433 B
Ruby
require 'rails_helper'
|
|
|
|
# Specs in this file have access to a helper object that includes
|
|
# the SearchHelper. For example:
|
|
#
|
|
# describe SearchHelper do
|
|
# describe "string concat" do
|
|
# it "concats two strings with spaces" do
|
|
# expect(helper.concat_strings("this","that")).to eq("this that")
|
|
# end
|
|
# end
|
|
# end
|
|
RSpec.describe SearchHelper, type: :helper do
|
|
pending "add some examples to (or delete) #{__FILE__}"
|
|
end
|