thinking-sphinx | Sphinx/Manticore plugin for ActiveRecord/Rails | Web Framework library
kandi X-RAY | thinking-sphinx Summary
kandi X-RAY | thinking-sphinx Summary
Sphinx/Manticore plugin for ActiveRecord/Rails
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Merge a search into the options hash
- Perform provided scopes for the given query
- Default configuration for the current scope .
- Search for one or more documents
- Define a new scope .
- Determine what to be used to customize .
- Checks if method is missing
- Merge facets
- Merge a search function
- Count the number of pages for a given query .
thinking-sphinx Key Features
thinking-sphinx Examples and Code Snippets
Community Discussions
Trending Discussions on thinking-sphinx
QUESTION
On a relatively old Rails app and Heroku Stack (16) trying to run rake ts:rebuild
:
ANSWER
Answered 2021-Feb-15 at 03:55I couldn't figure out a good way to debug this, but I upgraded thinking_sphinx
(3.1.4 -> 4.4.1) and flying_sphinx
(1.2.1 -> 2.2.0) and the error went away!
QUESTION
We ported our Rails 5.2 app to Heroku and were able to get almost everything working with FlyingSphinx.
Search and indexing work well but as a convenience to our users, we try to let them know when the daemon is down for service or if we're re-indexing.
Previously, we were able to use
ThinkingSphinx::Configuration.instance.controller.running?
But this always returns false
on Heroku even if the daemon is running.
Our thinking_sphinx.yml
doesn't specify file locations or information on where the pid is, so I suspect this may be the issue; however, I can't find anywhere that would explain what to use in thinking_sphinx.yml
for Heroku/FlyingSphinx, if it's at all necessary https://freelancing-gods.com/thinking-sphinx/v3/advanced_config.html.
Our thinking_sphinx.yml
looks like this now:
ANSWER
Answered 2020-Jun-25 at 00:13Ah, I've not had this requested before, but it's definitely possible:
QUESTION
Using thinking_sphinx
to fetch data from records. It working fine but facing an issue that not find any to get records on date comparison like created_at greater than or less than. I check their official documentation also Thinking Sphinx
Is thinking sphinx provide that way? If yes then can we do that
...ANSWER
Answered 2019-Oct-21 at 12:22It is possible, but it's not entirely obvious.
What you'll need to do is add an extra column in the SELECT clause, and then filter by that. Something along the lines of:
QUESTION
Using thinking-sphinx
for facets in my app and define two facets price
and year
.
I want to fetch facets nested results.
Now I am getting facets by year and it give count against year.
...ANSWER
Answered 2019-Sep-29 at 04:47I think this code does what you want - though you may need to tweak things to get exactly what you're after:
QUESTION
Using thinking-sphinx
to fetch records and it works fine. But the issue is that I want to fetch associated records also in results to improve site performance.
Like I want to fetch pictures of articles also along with articles .
Tried this one but its not working
...ANSWER
Answered 2019-Aug-08 at 01:44Since Thinking Sphinx v3, the :include
option is now within the :sql
option:
QUESTION
I am using Sphinx 2.2.11-id64-release
and gem 'thinking-sphinx', '3.3.0'
.
rake ts:configure
works fine and generated development development.sphinx.conf
But when running sphinx rake ts:index ts:start
it fails and shows these errors in logs:
ANSWER
Answered 2018-Dec-22 at 02:24As @barryhunter has noted, the issue here is the number of files that you're allowed to open at an operating system level. You're hitting this because of the large number of Sphinx indices you've got defined - but there should be ways around it - perhaps by using ulimit
, as Barry's linked to in the comment.
QUESTION
Hitting an OutOfBoundsError as a consequence of misunderstanding the proper configuration syntax (which may also be a by-product of legacy syntax).
The manual suggests a Class search taking on WillPaginate styled parameters. Having many fields to draw from, the model is defined as
...ANSWER
Answered 2018-Jun-20 at 15:46I'm not sure what BaseSearch
is doing with set_per_page
(that's certainly not a Thinking Sphinx method), but it's worth noting that Sphinx defaults to a maximum of 1000 records. It is possible to configure Sphinx to return more, though - you need to set max_matches in your config/thinking_sphinx.yml
to your preferred limit (per environment):
QUESTION
I want to create two indices for the same model and search separately
I am using
...ANSWER
Answered 2017-Dec-13 at 08:21In TS v3, the search option is now :indices
rather than :index
, and expects an array of index names. So, try the following:
QUESTION
I have recently upgraded my app to Rails 5 and I now get an error when I want to Index (see stacktrace below).
Only if I comment these two lines in my index is TS able to create the Index:
...ANSWER
Answered 2017-Aug-18 at 14:17It turned out that the part , -> { uniq }
was causing the problem.
When I replaced it with , -> { distinct }
the indexer would finally run through.
QUESTION
I'm trying to convert a delta-based index in ThinkingSphinx into a realtime one. Per the docs, I've added this callback:
after_save ThinkingSphinx::RealTime.callback_for(:location)
That works just fine for adding and updating records, woo. My problem is in deleting records, which according to the Rails docs, don't trigger after_save
callbacks. I've confirmed this by deleting a record, which is not then deleted from my sphinx index.
I tried
after_destroy ThinkingSphinx::RealTime.callback_for(:location)
But this raises an error (as the realtime callbacks do not support after_destroy
).
How can I remove an entry from my index when using a real time index?
(thinking-sphinx 3.3.0
, rails 5.0.4
, if that helps)
ANSWER
Answered 2017-Jul-05 at 01:06Thinking Sphinx automatically adds its own after_destroy
callback to all indexed models, so removal of these records from real-time indices should happen without you needing to add any code.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install thinking-sphinx
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page