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 5850077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:05:26+00:00 2026-05-22T13:05:26+00:00

I need thinking_sphinx query to retrieve begins_with values. means if I give Student.search ‘a’,

  • 0

I need thinking_sphinx query to retrieve “begins_with” values.
means if I give Student.search ‘a’, I want to display all student who have name starts with a.
I have indexed the name field already.Now, to retrieve a student, I have to give the exact name.

  • 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-05-22T13:05:26+00:00Added an answer on May 22, 2026 at 1:05 pm

    Sounds like you want wildcard searches. Either add this to your config/sphinx.yml file – or create it if you don’t already have one:

    development:
      enable_star: 1
      min_prefix_len: 1
    # repeat for other environments
    

    Or you can put it in a specific index – as infix/prefix settings increase the size of your indices dramatically:

    define_index do
      # ...
    
      set_property :enable_star => 1
      set_property :min_prefix_len => 1
    end
    

    And then, run rake ts:rebuild so the changes are known by Sphinx and processed in the indices, and then you can search like this:

    Student.search 'a*'
    # or
    Student.search :conditions => {:name => 'a*'}
    

    And if you use min_infix_len instead of min_prefix_len, you can match within words as well – that is, put the star on either side:

    Student.search '*a*'
    

    Finally – if you always want your queries to have wildcard stars on each end of every term, use :star => true in your searches:

    Student.search 'a b c', :star => true
    # is the same as
    Student.search '*a* *b* *c*'
    

    Hope this helps you get the result you’re looking for 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my search part successfully with the thinking_sphinx gem and I have
I need help thinking up a design where clients connect and communicate with all
I'm trying to make a query that selects all messages from a specific user
I'm developing a web app using Django, and I'll need to add search functionality
Details When a user first logs into my app I need to import all
I have a database table with images that I need to display. In my
I need to add thinking-sphinx delta column in my table that is having 17Million
My current thinking: I need a certain module that will let me access the
Maybe I am just over thinking this and need to write some more prototype
I need to benchmark a site, and was thinking of using ab (Apache Benchmark)

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.