简体   繁体   English

Searchlogic-搜索完全匹配

[英]Searchlogic - searching for exact match

I am using Searchlogic to perform searches on my 'report' index page. 我正在使用Searchlogic在“报告”索引页上执行搜索。

<% form_for @search do |f| %>
  Search:
  <%= f.text_field :report_id_like, :size=> 50 %>
  <%= f.submit "Search" %>
<% end %>

Currently, if I search for a report with report id '5', I get a list of entries with report id containing '5'. 当前,如果我搜索报告ID为“ 5”的报告,则会获得报告ID为“ 5”的条目列表。

I would like to get only the record with report_id '5' when I input '5'. 当我输入'5'时,我只想获取带有report_id'5'的记录。

Any suggestion? 有什么建议吗?

Many thanks 非常感谢

Got the answer: 得到了答案:

Instead of : 代替 :

<%= f.text_field :report_id_like, :size=> 50 %>

Put: 放:

<%= f.text_field :report_id_equals, :size=> 50 %>

Hope it might be of help to someone else 希望对别人有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM