任何人都可以推荐一款宝石搜索,实际上可以让我轻松过滤轨道上的红宝石结果吗? [英] Can anyone recommend a gem for searching that actually allows me to easily filter my results in ruby on rails?

查看:135
本文介绍了任何人都可以推荐一款宝石搜索,实际上可以让我轻松过滤轨道上的红宝石结果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在指向那个方向后思考狮身人面像,简单的过滤似乎是不可能的。我已经搜索了两天,现在问了问题,看起来不能做到这一点,这是令人震惊的,因为这是在网站上搜索时常用的东西。



所有我想要为我的搜索表单添加过滤选项,例如通过一个或多个过滤组合进行过滤:



当用户点击浏览页面时,所有网站用户都会返回,但显示20每页结果

过滤选项



in:位置



性别偏好 b
$ b

年龄段:年龄段



位于国家/地区

我的搜寻网页正常运作, require是用户用于通过电子邮件,用户名或全名查找用户的1个文本字段。我的浏览页面是一个不同的故事,因为我使用的是具有多个文本字段和一个或两个选择字段的表单。
$ b 示例

有没有一种宝石可以轻松做到这一点,并同时表现良好?



或者通过find方法手动执行此操作是唯一方法吗?



亲切的问候

解决方案

除了使用狮身人面像和思维狮身人面像,你可以想到那些宝石: meta_where meta_search



然而,在阅读您的描述后,我认为斯芬克斯确实是这里的最佳选择。

你写道,使用思维狮身人面像应用简单的过滤似乎是不可能的。让我解释一下思考狮身人面像内你提到的链接:例子


I've tried thinking sphinx after being pointed in that direction and simple filtering seems impossible. I've googled and asked questions for 2 days now and it seems it can't be done which is shocking because it's something commonly done when searching on websites.

All I would like to do add filtering options to my search form such as filtering by one or a combination of:

When user hits browse page all the sites users are returned but showing 20 results per page

Filtering options

in: location

who are: sexual preference

between the ages: age range

and located in: country

My search page works fine because all I require is 1 textfield a user uses for finding users by email, username or full name. My browse page is a different story because I'm using 1 form with multiple text fields and one or two select fields.

Example

Is there a gem that does this easily and performs well at the same time?

or would doing this manually via find methods be the only way?

Kind regards

解决方案

Apart from using Sphinx and Thinking Sphinx, you can think of those gems: meta_where and meta_search

However after reading your description I think Sphinx is the best choice here indeed.

You wrote that it seems impossible to apply simple filtering using Thinking Sphinx. Let me explain a bit of Thinking Sphinx within the post you mentioned under the link: Example

这篇关于任何人都可以推荐一款宝石搜索,实际上可以让我轻松过滤轨道上的红宝石结果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆