cost 381 ms
使用 pg_search 和 associated_against 查詢 with_deleted 記錄

[英]Query with_deleted records using pg_search and associated_against

在我的項目中,我有一個名為Log的 model,它跟蹤對Item執行的所有活動。 Item可以被軟刪除(使用acts_as_paranoid gem)。 我使用pg_search實現了全文搜索,以便能夠搜索與具有給定title的項目關聯的日志當前log.rbclass Log < Appli ...

如何使用 PgSearch 的 multisearch_options 從 model 實例的語言設置詞干詞典語言?

[英]How to use PgSearch's multisearch_options to set the stemming dictionary language from the model instance's language?

使用 PgSearch,我想使用詞干詞典在 multisearch 中進行全文搜索(數據庫是 Postgres 15)。 在我的 model 上,我有:class MyModel < ApplicationRecord include PgSearch::Model PgSearch ...

Pg_Search 不過濾引用另一個的 model

[英]Pg_Search don't filter model referenced to another

我正在更新一個小型圖書館應用程序,我的搜索過濾器 (pg_search) 不適用於被另一個引用的 model(在本例中,model Book as User references,每個用戶都有自己的一套書)。 但是,如果我刪除參考文獻,則搜索有效...如果每個用戶都可以使用這些書,但這不是目的。 ...

如何將 pg_search_scope 與 Mobility 一起用於翻譯屬性?

[英]How to use pg_search_scope with Mobility for translated attributes?

我如何將 pg_search_scope 與 Mobility 結合使用以獲取已翻譯的屬性? 可用的語言是:de 和:en。 搜索類別名稱返回空結果。 必須有一種方法來搜索 locale_accessors,在我的例子中它應該是 name_de || name_en 取決於當前的 i18n.lo ...

Rails Pg_Search 在沒有更改代碼的情況下停止工作

[英]Rails Pg_Search stopped working with no code changed

我有一個實現了 pg_search 的圖書館管理應用程序; 一切工作正常,突然間它開始在索引上顯示所有項目,但我沒有更改任何關於該功能的內容。 我會留下所有相關的代碼,如果它需要更多的東西,請告訴我。 提前致謝。 書本.rb book_controller.rb _book_search_bar ...

你如何在 Rails 中使用 LIKE 查詢枚舉?

[英]How do you use LIKE query for enum in rails?

我已將枚舉 task_status 設置為: 現在我必須使用搜索參數“掛起”來搜索所有處於掛起狀態的任務。 我正在使用 pg_search 進行搜索,但它不適用於枚舉,所以我想使用 LIKE 查詢進行查詢: 但這給了我錯誤 ActiveRecord::StatementInvalid (PG::U ...

如何使 pg_search 更快?

[英]How can I make pg_search faster?

我正在嘗試在我的 rails 應用程序中實現 pg_search。 我已經讓它工作了,但搜索速度很慢,超過 20 秒。 我的addresses表中有超過 700 萬條記錄。 有什么方法可以讓它更快嗎? 應用程序/模型/地址.rb 更新我已經添加了這個索引,但它似乎仍然一樣慢 ...

rails pg_search 關聯搜索

[英]rails pg_search search in association

我有3個模型 在 Pg_search 之前我是這樣搜索的 現在我添加 pg_search gem 並修改Album類 在專輯模型中搜索工作正常,但如何修改舊查詢以通過 pg_search 進行搜索? ...

Pg_search:參數數量錯誤(給定 2,預期為 1)

[英]Pg_search: Wrong number of arguments (given 2, expected 1)

我正在嘗試使用Pg_search gem 向我的Rails 6應用程序添加搜索功能。 我已將 gem 添加到我的Gemfile ,並使用以下方法安裝它: 但是,當我啟動Rails 服務器時,嘗試在瀏覽器上訪問應用程序時出現以下錯誤: 這是它的圖像: 我想知道我做錯了什么。 ...

如何使用 PostgreSQL 全文搜索返回部分短語匹配而不返回太多行?

[英]How do I return partial phrase matches with PostgreSQL full-text search without returning too many rows?

我正在使用pg_search gem 在 PostgreSQL 中執行全文搜索,並且運行良好。 但是,某些搜索在應有的情況下沒有返回任何視頻結果。 例如,搜索“物質狀態”會返回 10 個結果,因為視頻有一個名為“物質狀態”的標簽。 但是“3 種物質狀態”返回零結果。 同樣,“放射性碳測年”返回 1 ...

導軌 controller 未加載擴展 class

[英]Rails controller not loading extended class

我在一個小項目中使用 rails (5.0.7.2)。 對於標簽,我選擇acts-as-taggable-on 和搜索 pg_search gems。 由於我希望標簽是可搜索的,我首先在應用程序目錄中創建了一個名為“utilities”的文件夾。 然后我在該文件夾中創建了一個名為“search_t ...

搜索未回復過濾結果

[英]Search does not reply with the filtered result

全部, 請幫我一個簡單的功能...我無法確定錯誤。 所以這是我的簡單用戶故事預期:作為用戶,我希望根據我的搜索條件(例如標題、描述)獲得結果列表實際:我得到的:-( 總是完整的引腳列表,而不是過濾的。 為此,我使用 gems pg_search 並且我的視圖是用 HAML 編寫的 applicati ...

Rails:使用 PG 搜索進行過濾不起作用

[英]Rails: Filtering with PG search not working

我目前正在 Ruby on Rails 中建立一個在線圖書館,其中包含不同子類別和類別的書籍。 換句話說; 我正在使用 PG_search 搜索功能,這是我搜索書籍的搜索方法,效果很好: 我的 controller 的索引操作如下所示: 但是當我嘗試在我的書籍 controller 的索引操作中按類 ...

PSQL 數據庫更新觸發器更新程序有效。 但是插入過程沒有

[英]PSQL Database Update trigger update procedure works. But insert procedure doesn't

我目前正在嘗試為我的 rails 應用程序實現 Postgres 文本搜索。 我的遷移成功運行,創建了所有表。 我的一個遷移添加了一個觸發器來更新我的列表表上的 ts_vector 列 (TSV)。 它在表上執行一堆連接,在中間表上執行兩個連接。 不確定這個觸發器是否最有效,但它在被過程調用時有效。 ...

Rails 遷移運行沒有錯誤,但不會創建 tsvector 列、GIN 索引或 TRIGGER

[英]Rails migration runs without errors but doesnt create tsvector column, GIN index or TRIGGER

我目前正在使用 pg_search for PostgreSQL full text search 在我的 rails 應用程序中實現搜索功能。 不幸的是,我在遷移以在列表表中添加 tsvector 列、GIN INDEX 和 TRIGGER 時遇到了問題。 遷移成功運行,但不會創建遷移文件中指定的 ...

with_pg_search_highlight 與關聯字段

[英]with_pg_search_highlight with associated field

目前我正在嘗試在關聯的表字段上使用 with_pg_search_highlight 執行 pg_search,我得到: PG::UndefinedTable: ERROR: missing FROM-clause entry for table "pg_search_17ebb3b05265b7 ...

pg_search gem 返回重復項

[英]pg_search gem returns duplicates

我正在使用pg_search gem在模型中搜索並注意到某些搜索返回相同結果的重復。 當我搜索Client.client_search("abc") ,我的結果數組多次包含相同的Client 。 每個條目都有相同的 ID,結果似乎無法區分。 知道為什么結果是重復的嗎? ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM