takezoe / solr-scala-client

Solr Client for Scala
Apache License 2.0
91 stars 43 forks source link

Query Solr did not work well #34

Closed hendisantika closed 6 years ago

hendisantika commented 7 years ago

I have tried your example for regular client and Async but it did not work for query. I have created a repo so that so can try it. https://github.com/hendisantika/Coba-Solr

Here are my notes :

  1. Coba.scala --> It add to solr repo but the query result is not working
  2. AsyncSolrClientSample.scala --> Can not add and query.
  3. SolrClientSample.scala --> Can not add and query.

Please give me an advice and solution.

Thanks

takezoe commented 7 years ago

Coba.scala --> It add to solr repo but the query result is not working

If following query works, schema is invalid. Has name field been tokenized correct?

val result = client.query("id: %id%")
  .fields("id", "manu", "name")
  .sortBy("id", Order.asc)
  .getResultAsMap(Map("id" -> "001"))

AsyncSolrClientSample.scala --> Can not add and query.

I tested and worked in my environment. It's strange...

SolrClientSample.scala --> Can not add and query.

Remove following code which provides a mock client. If this code is available, all methods of client don't access to the real Solr server.

  implicit val solr = SolrClientFactory.dummy { request =>
    println(request.getMethod)
    println(request.getPath)
    println(request.getParams)
  }
hendisantika commented 7 years ago

I have tried on my Environment but the result was not ok. Could you please test my repo https://github.com/hendisantika/Coba-Solr It originally from your sample.

takezoe commented 7 years ago

Let me know details of your situation. There are too few clues to find a cause.

hendisantika commented 7 years ago
  1. I follow your example. It is exactly same with your code because I copied from yours.
  2. Yes, I did. It add to repo. But the query result was not print the result on the terminal. It just add to the solr repo not executed the query.
  3. Empty result. Nothing print on my terminal.

My 2 friends are also tried my repo. They are still have the same issues like mine.

takezoe commented 7 years ago
  1. I follow your example. It is exactly same with your code because I copied from yours.

Sorry, my words was not enough. I want to reproduce your environment to test your code on same situation as you. So let me know:

  1. Yes, I did.
  2. Empty result. Nothing print on my terminal

Thanks. I have two more question to you:

hendisantika commented 7 years ago
  1. I installed via this tutorial. I run via browser to open my solr repo. I created my repo via the above too.
  2. It is printed on my IDEA Console 'registered' but then the stacktrace come. I dont think so.

Have you clone my repo? have you tried it?

takezoe commented 7 years ago

Result depends on environment. In my environment:

From these results, I can say:

I will raise new issues about them. But I couldn't find other problem. In particular, the sync client has worked with no problem.

I guess name field is not tokenized in your environment because your gettingstarted collection was created with data_driven_schema_configs option. Therefore maybe only exact match search is available for this field. However this is just my guess.

This is all I can do. Unfortunately, maybe I can't help you any more.

hendisantika commented 7 years ago

Ooo.. I see that.

I want to use yout Async method for my test.

At least I know the issue from your explainations.

By The way.

Arigatou Gozaimasu. :+1:

takezoe commented 7 years ago

Fix async client example in 0a6943683991b22531f12723234b8f10d00a1c90. Querying had required waiting registration. I confirmed that async client work well in this code.

hendisantika commented 7 years ago

OK. I will retry. Thanks to you @takezoe