Coder Social home page Coder Social logo

Comments (7)

karmi avatar karmi commented on June 22, 2024

Can you gist/pastie the full recreation with Curl commands (trace:true)? It's hard to say what's up here.


Discussion.first.__elasticsearch__.as_indexed_json -- since you define your own as_indexed_json, just call Discussion.first.as_indexed_json.

from elasticsearch-rails.

melhotiby avatar melhotiby commented on June 22, 2024

@karmi - Not sure the best way to do that...is that provided in the gem

from elasticsearch-rails.

karmi avatar karmi commented on June 22, 2024

@railsdevmatt Of course. I assume you've set aside enough time to study the resources such as https://github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-model#the-elasticsearch-client and https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport#logging?

from elasticsearch-rails.

melhotiby avatar melhotiby commented on June 22, 2024

@karmi - the only problem I see is that Elasticsearch::Client.new trace: true and since we are not calling a client directly, im not sure where the trace goes

from elasticsearch-rails.

karmi avatar karmi commented on June 22, 2024

@railsdevmatt I'm getting more and more confused. Have you actually checked https://github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-model#the-elasticsearch-client, have you tried it? It will print to STDERR by default. The other link has a very specific advice on how to put the log/trace output into a file.

from elasticsearch-rails.

melhotiby avatar melhotiby commented on June 22, 2024

@karmi - my bad. I misread that the settings needed to go in an initializer

here is the curl

curl -X GET 'http://localhost:9200/articles_development_index,series_development_index,discussions_development_index/article,series,discussion/_search?pretty' -d '{"from":0,"size":20,"filter":{"and":[{"missing":{"field":"deleted_at","existence":true,"null_value":true}},{"or":[{"not":{"exists":{"field":"published"}}},{"term":{"published":true}}]}]},"query":{"query_string":{"query":"orange","default_operator":"AND"}}}'
 |
 | # 2014-03-06T10:45:44-05:00 [200] (0.006s)
 | #
 | # {"took":1,"timed_out":false,"_shards":{"total":3,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}

and here is the log

|   Parameters: {"utf8"=>"✓", "q"=>"orange"}
| 2014-03-06 10:47:23 -0500: GET http://localhost:9200/articles_development_index,series_development_index,discussions_development_index/article,series,discussion/_search [status:200, request:0.006s, query:0.000s]
| 2014-03-06 10:47:23 -0500: > {"from":0,"size":20,"filter":{"and":[{"missing":{"field":"deleted_at","existence":true,"null_value":true}},{"or":[{"not":{"exists":{"field":"published"}}},{"term":{"published":true}}]}]},"query":{"query_string":{"query":"orange","default_operator":"AND"}}}
| 2014-03-06 10:47:23 -0500: < {"took":0,"timed_out":false,"_shards":{"total":3,"successful":3,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

from elasticsearch-rails.

melhotiby avatar melhotiby commented on June 22, 2024

@karmi - just realized the import

Discussion.import

fixed the issue

from elasticsearch-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.