1
如何使用两个搜索文本参数pg-search +搜索筛选器1 +搜索筛选器2进行Postgres搜索。如何使用两个搜索文本参数postgres搜索搜索筛选文本1 &&搜索筛选文本2
如何pg_Search输出搜索我想要的“过滤器1” & &“过滤器1”
@output = PgSearch.multisearch("filter 1") + PgSearch.multisearch("filter 2")
如何使用两个搜索文本参数pg-search +搜索筛选器1 +搜索筛选器2进行Postgres搜索。如何使用两个搜索文本参数postgres搜索搜索筛选文本1 &&搜索筛选文本2
如何pg_Search输出搜索我想要的“过滤器1” & &“过滤器1”
@output = PgSearch.multisearch("filter 1") + PgSearch.multisearch("filter 2")
的联盟我是作者和pg_search的维护者。
在PostgreSQL全文搜索中,默认情况下搜索条件加入了AND。因此,你可以简单地这样做:
@output = PgSearch.multisearch("filter 1 filter 2")
假设你已经在字符串变量的查询词,它看起来像这些之一:
@output = PgSearch.multisearch("#{query1} #{query2}") # if query1 and query2 are strings
@output = PgSearch.multisearch(queries.join(" ")) # if queries is an array of strings
加入由或者是复杂得多。我还没有一个简单的解决方案,尽管它应该是可能的。