Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to search for partial terms #5

Closed
jimmckerchar opened this issue Oct 2, 2012 · 7 comments
Closed

Unable to search for partial terms #5

jimmckerchar opened this issue Oct 2, 2012 · 7 comments

Comments

@jimmckerchar
Copy link

Sphinx allows configuration of wildcard searches and searches for partial terms using :enable_star and :min_infix_len/:min_prefix_len, it would be useful to be able to configure these within moonshine.yml.

Thanks

@technicalpickles
Copy link
Contributor

You can do this already :) Try adding this to config/moonshine.yml (values may change depending on what you need)

:sphinx:
  :extra:
    :enable_star: 1
    :allow_star: false
    :min_infix_length: 0
    :min_prefix_length: 1

Anything in this extra block gets put into the generated sphinx.yml at deploy time.

@jimmckerchar
Copy link
Author

Hmmm. I've already tried in the extra block with no success.

Just had a conversation with @railsmachine on twitter and was recommended to open this as an issue.

@technicalpickles
Copy link
Contributor

I know, I was watching ;)

That :extra option hasn't always been there, so you may need to update moonshine_sphinx to get it working. You'd be able to tell if you are up to date if your vendor/plugins/moonshine_sphinx/templates/sphinx.yml has these lines: https://github.com/railsmachine/moonshine_sphinx/blob/master/templates/sphinx.yml#L10-13

On Oct 2, 2012, at 9:46 AM, Jim McKerchar notifications@github.com wrote:

Hmmm. I've already tried in the extra block with no success.

Just had a conversation with @railsmachine on twitter and was recommended to open this as an issue.


Reply to this email directly or view it on GitHub.

@jimmckerchar
Copy link
Author

@technicalpickles :)

yes i have those lines. is the integer value for :enable_star important? I was using a boolean as per the Sphinx docs.

@technicalpickles
Copy link
Contributor

Not sure, I just pulled those examples from ones I found.

What does the generated sphinx.yml look like after deploy? ie /sv/app/shared/config/sphinx.yml

  • Josh

On Oct 2, 2012, at 9:52 AM, Jim McKerchar notifications@github.com wrote:

@technicalpickles :)

yes i have those lines. is the integer value for :enable_star important? I was using a boolean as per the Sphinx docs.


Reply to this email directly or view it on GitHub.

@jimmckerchar
Copy link
Author

sphinx.yml...

production:
  searchd_file_path: /srv/****/shared/sphinx/production
  searchd_files: /srv/****/shared/sphinx/production
  config_file: /srv/****/shared/config/sphinx.conf
  log: /srv/****/shared/log/searchd.log
  query_log: /srv/****/shared/log/searchd.query.log
  pid_file: /srv/r****/shared/log/searchd.pid
  bin_path: /usr/local/bin
  version: 0.9.8
  address: 127.0.0.1
  mem_limit: 64M
  enable_star: 1
  min_infix_len: 3

The yml looks ok, but it isn't searching as i'd expect. I have "house" indexed but if i search for "hou" no results are returned. I'm now thinking i've got my wires crossed somewhere (can you maybe shed some light on this).

I'll close this as it obviously isn't an issue... more a misunderstanding on my part.

thankyou.

@technicalpickles
Copy link
Contributor

No problem. I haven't messed with the infix length before, so can't help much there. Maybe try on the thinking-sphinx mailing list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants