Denny Deng

Joined 3/8/2017
# Name
Denny Deng said almost 2 years ago:

curl http://localhost:9200

I got "unknown regexp options - lcalht", however, elasticsearch.log shows I had started elasticsearch fine.

what did I do wrong?

Thanks in advance

Denny Deng said almost 2 years ago:

never mind of my previous comment...forget it. Sorry!

Denny Deng said almost 2 years ago:

never mind of my previous comment...forget it. Sorry!

Denny Deng said almost 2 years ago:

Hello,

I have cloned your code to my ubuntu 16.04 running Ruby 2.3.3 with rails 5.0.1.

Everything works except autocomplete. I got a 500 Internal Server Error.

The console in Chrome browser showed that it got a stop at line 9537 of Jquery3, It stops at the same line no mater Jquery, Jquery2, or Jquery3 

The line shows the following code as,

xhr.send( options.hasContent && options.data || null );

Any hints for me?

Thanks in advance!



Denny Deng said almost 2 years ago:

elasticsearch works in my server. However, I am not sure if I need to configure it for this tutorial.

kobaltz PRO said almost 2 years ago:

Error 500 indicates that something went wrong on the server side and it should have logged something into your application logs. Check there and if you're unable to figure it out, post the relevant section of the log please.

Denny Deng said almost 2 years ago:

Sorry, I did not know the format would mess up like this. My email is [email protected] I will send you a email about the log message if you give your email address.

Denny Deng said almost 2 years ago:

elasticsearch works in my server. However, I am not sure if I need to configure it for this tutorial.

Denny Deng said almost 2 years ago:

http://localhost:3000 works

As soon as I typed letter "i", autocomplete started to give me  some error messages.

After "iron" and search, then

Movie.search(search, where: { year: { gt: 2000 } })

is highlighted to indicate where it stopped. What is your Ruby version? I got 2.3.3, perhaps I should try your Ruby version. Thank you for looking into this!

def index
  search = params[:term].present? ? params[:term] : nil
  @movies = if search
    # Movie.where("title LIKE ? OR plot LIKE ?", "%#{search}%", "%#{search}%")
    Movie.search(search, where: { year: { gt: 2000 } })
  else
    Movie.all
  end
end
Searchkick::InvalidQueryError - [400] {"error": {"root_cause": [{"type": "query_shard_exception","reason": "[match] analyzer [searchkick_word_search] not found","index_uuid": "3I4KbiHfSBqIYPWZlzkFKA","index": "movies_development"}], "type": "search_phase_execution_exception","reason": "all shards failed","phase": "query","grouped": true,"failed_shards": [{"shard": 0,"index": "movies_development", "node": "OvOTxtcQQpusc1OQk8tvMQ","reason": {"type": "query_shard_exception","reason": "[match] analyzer [searchkick_word_search] not found","index_uuid": "3I4KbiHfSBqIYPWZlzkFKA","index": "movies_development"}}],"caused_by": {"type": "query_shard_exception","reason": "[match] analyzer [searchkick_word_search] not found","index_uuid": "3I4KbiHfSBqIYPWZlzkFKA","index": "movies_development"}}, "status": 400}: 

kobaltz PRO said almost 2 years ago:

Have you tried reindexing your Movie model?

You can within the console run

# BASH
rails c
# RAILS CONSOLE
Movie.reindex


or straight from Bash

rake searchkick:reindex CLASS=Movie

Denny Deng said almost 2 years ago:

I cannot believe I missed reindexing. Thanks a lot! Everything is working now.

kobaltz PRO said almost 2 years ago:

Sweet! Glad that worked!

Denny Deng said almost 2 years ago:

Sorry, I did not know the format would mess up like this. My email is [email protected] I will send you a email about the log message if you give your email address.

Denny Deng said almost 2 years ago:

I cannot believe I missed reindexing. Thanks a lot! Everything is working now.

kobaltz PRO said almost 2 years ago:

Sweet! Glad that worked!

Denny Deng said over 1 year ago:

I think the original code of client_side_validations had been changed since you made this tutorial.


For one, their is no line of 658 in rails.validations.js. There are a total of only 574 lines.

Secondly,

gem 'client_side_validations',

    github: 'DavyJonesLocker/client_side_validations',

    branch: 'rails5'

gem 'client_side_validations-simple_form',

    github: 'DavyJonesLocker/client_side_validations-simple_form',

    branch: 'rails5'

It would get me an error message when I bundle installed.

I am struglling to get this to work. Could you be kind enough to point me to right direction?

kobaltz PRO said over 1 year ago:

Their later versions should support Turbolinks and Rails 5. However, they did deprecate the Uniqueness validation as it could be seen as a security risk. You shouldn't have to specify the branch anymore.

Denny Deng said over 1 year ago:

gem 'client_side_validations'

I tried to bundle install this and worked.

With so many trial and errors, I still could not figure this out. 

Denny Deng said over 1 year ago:

It is working now after I have restarted the server!


Thank you  so much!

kobaltz PRO said over 1 year ago:

Great! Glad to hear!

Denny Deng said over 1 year ago:

gem 'client_side_validations'

I tried to bundle install this and worked.

With so many trial and errors, I still could not figure this out. 

Denny Deng said over 1 year ago:

It is working now after I have restarted the server!


Thank you  so much!

kobaltz PRO said over 1 year ago:

Great! Glad to hear!