Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:29:49+00:00 2026-06-17T09:29:49+00:00

Would this require full-text search or is it possible to do with a method?

  • 0

Would this require full-text search or is it possible to do with a method?

I have a table of Chinese sentences and I want to find all the records that include a string.

For example:

irb(main):007:0> Hint.all
  Hint Load (0.7ms)  SELECT "hints".* FROM "hints" 
[
    [0] #<Hint:0x007fb99c9d1900> {
                :id => 107,
          :sentence => "你叫什么名字?",
              :user => nil,
           :learned => nil,
        :created_at => Sat, 05 Jan 2013 21:04:06 UTC +00:00,
        :updated_at => Sat, 05 Jan 2013 21:04:06 UTC +00:00
    },
    [1] #<Hint:0x007fb99f2acc30> {
                :id => 108,
          :sentence => "当时有约翰做他们的助手。",
              :user => nil,
           :learned => nil,
        :created_at => Sat, 05 Jan 2013 21:04:23 UTC +00:00,
        :updated_at => Sat, 05 Jan 2013 21:04:23 UTC +00:00
    },
    [2] #<Hint:0x007fb99f2ac618> {
                :id => 109,
          :sentence => "马可和家人可能过着舒适的生活,因为他们在城里有自己的房子,家里有仆人。",
              :user => nil,
           :learned => nil,
        :created_at => Sat, 05 Jan 2013 21:19:43 UTC +00:00,
        :updated_at => Sat, 05 Jan 2013 21:19:43 UTC +00:00
    }
]

I want to search for “名字” and it return a list of records that have that string in the sentence table. In this case it would find a match in [0].

(if full-text search is required, can you recommend something that will work with Chinese and heroku, as close to free as possible?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:29:50+00:00Added an answer on June 17, 2026 at 9:29 am

    Can you do something like this or am I missing something about unicode symbols?

    Hint.where("sentence LIKE '%名字%'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a table with an auto-incrementing surrogate key. Would this be a
I have a table that lists people and all their contact info. I want
require 'coderay' puts CodeRay.scan('puts Hello, world!', :ruby).page This code will print full HTML page
I have this in hi.rb require 'rubygems' require 'sinatra' get '/hi' do Hello World!
I have read that you can do it, but would this really improve performance
I have title (varchar), description (text), keywords (varchar) fields in my mysql table. I
I'm building a chat app and I want a full history off all messages
Would this be a proper way to dispose of a BackGroundWorker? I'm not sure
Would this be the correct way of declaring that an XML element Cluster contains
Why would this work timeout 10s echo foo bar # foo bar but this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.