Thursday 15 January 2015

python - Query with elastic4s yielding zero results -


I am learning Slavic and elastic 4s for elasticsearch

I have a dragon script that uses the official elasticity module. My code in Python looks like this:

helpers.scan (es, query = {"_ source": ["http_uri", "header_user_agent"], "query": {" Query_string ": {" Query ":" message: key "}}}, index =" ")

My Python code works, I get 900k results and I Take action and do this.

I am using basic scale code to view e4s. Is this just a simple query? Is my query wrong?

  import com.sksamuel.elastic4s.ElasticClient import com.sksamuel.elastic4s.ElasticDsl._Object Banana {DIF Main (Args: Array [String]) {val Client = ElasticClient.local val Res = client {search "" in "apiKey"} println (res.getHits.totalHits) println (res)}}  

My result is the following:

  info] Moving banana SLF4J: failed to load the class "org.slf4j.impl.StaticLoggerBinder". SLF 4J: No Operation (NOP) Logger Implementation SLF 4G: For more information see http://www.slf4j.org/codes.html#StaticLoggerBinder 0, "successful": 0, "failed": 0}, "hit": {"total": 0, "successful" Max_score ": 0.0," hit ": []}}  

and response with curl query:

  $ curl -s 'localhost: 9200 / _search? Q = apiKey and beautiful = true' | ("total": 1200, "successful" : 1200, "Failed": 0}, "Hit": {"Total": 756253, "Max_score": 1.5905869, "Hit": [{code>   

  wall client = elasticClient.local  

This line means that Lolautic 4S Will create your own data store, so if you do not index your data in this data, your search results If you want to connect to your own flexible , you can do the following:

  // Set the cluster name Val Settings = ImmutableSettings.settingsBuilder (). Put ("cluster.name", "Elasticsearch"). Build () // Set Cluster Connection Val Client = ElasticClient.remote (Settings, ("127.0.0.1", 9300)) < / Code> 

Find more action.


No comments:

Post a Comment