searchkick | Intelligent search | Autocomplete library
kandi X-RAY | searchkick Summary
kandi X-RAY | searchkick Summary
:rocket: Intelligent search made easy. Searchkick learns what your users are looking for. As more people search, it gets smarter and the results get better. It’s friendly for developers - and magical for your users. Check out Searchjoy for analytics and Autosuggest for query suggestions. :tangerine: Battle-tested at Instacart.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize Elasticsearch configuration
- Filter filters
- update language
- Initializes the search .
- Returns an array of records that match the request .
- Rebuild an index
- Sets aggregate_aggregation parameters .
- Handle the response
- Updates the stem of the stemerer .
- Fetches a filter for a given query .
searchkick Key Features
searchkick Examples and Code Snippets
Community Discussions
Trending Discussions on searchkick
QUESTION
Ruby 3.0.3
Rails 7.0.0.alpha2
elasticsearch 7.17.1
searchkick 5.0.3
My tests are all passing on local
but not on GitHub action and I don't know why...
Do you know how to show the details of the error 500?
This is a Capybara test
This is the config that I added
The results
...ANSWER
Answered 2022-Apr-04 at 09:01<500: Internal Server Error>
indicates that some exception has been raised in your controller that wasn't properly rescued. If you can't reproduce the issue on your development environment you can:
- Either add a
begin..rescue
in your controller's action, then inside the rescue do:p $ERROR_INFO.message
($ERROR_INFO
is a special variable that contains the last exception rescued, it's a more readable way to use$!
QUESTION
Ruby 3.0.3
Rails 7.0.0.alpha2
OS X 12.2.1
I installed on local Searchkick and followed the instructions to reindex the Company
model but I have this error.
ANSWER
Answered 2022-Mar-16 at 00:15I had to downgrade the version of elasticsearch
to 7.14
.
QUESTION
I am deploying my rails app via AWS. During the deployment I get the following error.
Automatic configuration of the sidekiq middleware is no longer done. Please see: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/README.md#add-the-middleware
This version deprecated the following sidekiq_options
- sidekiq_options lock_args: :method_name
It is now configured with:
- sidekiq_options lock_args_method: :method_name
This is also true for
Sidekiq.default_worker_options
We also deprecated the global configuration options:
- default_lock_ttl
- default_lock_ttl=
- default_lock_timeout
- default_lock_timeout=
The new methods to use are:
- lock_ttl
- lock_ttl=
- lock_timeout
- lock_timeout= Removing intermediate container 058b1862fa23 ---> d58eac1f9787 Step 22/28 : COPY --chown=app:app . . ---> f91e7b24a602 Step 23/28 : RUN bundle exec rake assets:precompile ---> Running in 49531771f9ca rake aborted! NameError: uninitialized constant Elasticsearch /home/app/webapp/config/initializers/elasticsearch.rb:11:in
' /usr/local/rvm/gems/ruby-2.6.8/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in
load' /usr/local/rvm/gems/ruby-2.6.8/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:inload' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/engine.rb:666:in
block in load_config_initializer' /usr/local/rvm/gems/ruby-2.6.8/gems/activesupport-6.0.4.6/lib/active_support/notifications.rb:182:ininstrument' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/engine.rb:665:in
load_config_initializer' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/engine.rb:625:inblock (2 levels) in ' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/engine.rb:624:in
each' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/engine.rb:624:inblock in ' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:32:in
instance_exec' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:32:inrun' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:61:in
block in run_initializers' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:50:ineach' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:50:in
tsort_each_child' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/initializable.rb:60:inrun_initializers' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/application.rb:363:in
initialize!' /home/app/webapp/config/environment.rb:5:in' /usr/local/rvm/gems/ruby-2.6.8/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require' /usr/local/rvm/gems/ruby-2.6.8/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' /usr/local/rvm/gems/ruby-2.6.8/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in
require' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/application.rb:339:inrequire_environment!' /usr/local/rvm/gems/ruby-2.6.8/gems/railties-6.0.4.6/lib/rails/application.rb:523:in
block in run_tasks_blocks' /usr/local/rvm/gems/ruby-2.6.8/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define' Tasks: TOP => environment (See full trace by running task with --trace) The command '/bin/sh -c bundle exec rake assets:precompile' returned a non-zero code: 1[Container] 2022/02/23 11:37:32 Command did not exit successfully docker build --build-arg RAILS_ENV --build-arg DATABASE_URL --build-arg REDIS_URL --build-arg SECRET_KEY_BASE -t $REPOSITORY_URI:latest . exit status 1 [Container] 2022/02/23 11:37:32 Phase complete: BUILD State: FAILED [Container] 2022/02/23 11:37:32 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker build --build-arg RAILS_ENV --build-arg DATABASE_URL --build-arg REDIS_URL --build-arg SECRET_KEY_BASE -t $REPOSITORY_URI:latest .. Reason: exit status 1 [Container] 2022/02/23 11:37:32 Entering phase POST_BUILD [Container] 2022/02/23 11:37:32 Running command echo Build completed on
date
Build completed on Wed Feb 23 11:37:32 UTC 2022[Container] 2022/02/23 11:37:32 Running command echo Pushing the Docker images... Pushing the Docker images...
[Container] 2022/02/23 11:37:32 Running command docker push $REPOSITORY_URI:latest The push refers to repository [413249046650.dkr.ecr.eu-west-1.amazonaws.com/legitimate-development] An image does not exist locally with the tag: 413249046650.dkr.ecr.eu-west-1.amazonaws.com/legitimate-development
[Container] 2022/02/23 11:37:32 Command did not exit successfully docker push $REPOSITORY_URI:latest exit status 1 [Container] 2022/02/23 11:37:32 Phase complete: POST_BUILD State: FAILED [Container] 2022/02/23 11:37:32 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker push $REPOSITORY_URI:latest. Reason: exit status 1 [Container] 2022/02/23 11:37:32 Expanding base directory path: . [Container] 2022/02/23 11:37:32 Assembling file list [Container] 2022/02/23 11:37:32 Expanding . [Container] 2022/02/23 11:37:32 Expanding file paths for base directory . [Container] 2022/02/23 11:37:32 Assembling file list [Container] 2022/02/23 11:37:32 Expanding imagedefinitions.json [Container] 2022/02/23 11:37:32 Skipping invalid file path imagedefinitions.json [Container] 2022/02/23 11:37:32 Expanding imagedefinitions2.json [Container] 2022/02/23 11:37:32 Skipping invalid file path imagedefinitions2.json [Container] 2022/02/23 11:37:32 Phase complete: UPLOAD_ARTIFACTS State: FAILED [Container] 2022/02/23 11:37:32 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found
The file referenced in the line below the error is:
...ANSWER
Answered 2022-Feb-23 at 14:15That file uses the Elasticsearch
constant in Elasticsearch::Client
, but Ruby does not know it.
Do you have the elasticsearch
gem in the Gemfile
in a group that is included in production? If yes, does it have require: false
?
QUESTION
I have a Ruby on Rails app for which I use Docker Compose to develop locally. I always use a copy of our production PostgreSQL database which is pretty large with around 500,000 rows. A lot of that data gets indexed for search in Elasticsearch using the Searchkick gem. I want to reproduce the production environment as closely as possible but I'm getting slowed down by the huge RAM usage of Elasticsearch on my laptop. I'm getting over 10GB of RAM usage often.
Has anyone thought of a solution for limiting the RAM usage of Elasticsearch just for local development?
Here are the Elasticsearch settings in my docker-compose.yml file:
...ANSWER
Answered 2022-Feb-10 at 21:25This is more of a docker config than elasticsearch. If you are using v2 of docker-compose , set the following flag in docker compose
Ref: Mem and CPU V2
QUESTION
My app uses Searchkick with Elasticsearch to return aggregations (as in the breakdown of categories etc) from your search which I use to build filters.
Now from this I can quickly get an array like:
...ANSWER
Answered 2022-Jan-31 at 18:08Yes, as you already suggest, there is a simple solution using map
.
Let's assume that you have already stored the id and count from ElasticSearch in the following array:
QUESTION
I'm working on a Rails application that uses Searchkick as an interface to Elasticsearch. Site search is working just fine, but I'm running into an unexpected issue on a page where I'm attempting to retrieve the most recent recoreds from Searchkick across a couple different models. The goal is a reverse chronological list of this recent activity, with the two object types intermingled.
I'm using the following code:
...ANSWER
Answered 2022-Jan-20 at 18:36Because Elasticsearch stores IDs as strings rather than integers, I solved this problem by adding a new obj_id
field in ES and ordering results based on that.
In my Post and Project models:
QUESTION
is it possible to use the keyword analyzer from https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-keyword-analyzer.html in searchkick?
I want a specific string analyzed in a text field.
...ANSWER
Answered 2022-Jan-07 at 15:37Yes you can provide an "advanced mapping":
QUESTION
I'm trying to add multi-language support of a Rails app which uses searchkick for search functionality.
After some research I've decided to go with the one language per field approach as described here. However, after googling for quite a bit, I couldn't find any documentation on this topic in terms of get it implemented with searchkick.
Essentially, I cannot find the way to specify a language analyzer for a given field using searchkick.
Any help would be appreciated.
...ANSWER
Answered 2021-Nov-25 at 17:17You have to use custom mapping with language analyzers
QUESTION
I am stuck trying to reindex a single model in SearchKick.
If I run the following command:
...ANSWER
Answered 2021-Sep-24 at 19:28You can re-index just the Profile
class using
QUESTION
We're trying to optimize our search requests by making a single bulk search, so we're trying to use Searchkick.multi_search
. However, it only returns Searchkick::Query
with the results populated in a results
attribute, as a regular Array
.
Then, now if I try results.with_highlights...
it fails with
ANSWER
Answered 2021-Sep-25 at 21:47Updated Answer for Searchkick 4.6.1+
Talked to Ankane from Searchkick here https://github.com/ankane/searchkick/pull/1518. He ended up releasing a new version with fixes to this then the original answer here is only valid up to Searchkick version 4.6.0.
For 4.6.1+ just do:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install searchkick
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