简体   繁体   中英

Searchlogic - searching for exact match

I am using Searchlogic to perform searches on my 'report' index page.

<% 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'.

I would like to get only the record with report_id '5' when I input '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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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