Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query_string] query does not support [all_fields] and cannot use [all_fields] parameter in conjunction with [default_field] or [fields] #91

Open
ksipma opened this issue Mar 7, 2019 · 2 comments

Comments

@ksipma
Copy link

ksipma commented Mar 7, 2019

I want to use marija with docker. I have 2 docker containers. one with marija and one with elasticsearch.
I seeded some fake data, the index looks like this:

GET es:9200/test_persons

{
  "test_persons": {
    "aliases": {},
    "mappings": {
      "person": {
        "properties": {
          "city": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "settings": {
      "index": {
        "creation_date": "1551956277080",
        "number_of_shards": "5",
        "number_of_replicas": "1",
        "uuid": "xxxxxx",
        "version": {
          "created": "2040699"
        }
      }
    },
    "warmers": {}
  }
}

I tried a whole lot of different elasticsearch versions in docker

My config of marija looks like this:

config-docker.toml

[datasource]

[datasource.test_persons]
type="elasticsearch"
url="http://es:9200/test_persons"

[[loggings]]
output = "stdout"
level = "debug"

I am not so experienced with elasticsearch, I hope it is just a stupid mistake. Can someone help me?

@ksipma
Copy link
Author

ksipma commented Mar 10, 2019

It seems this bit is incorrect in the datasource of elasticsearch:

file elasticsearchindexv5.go

q := elastic.NewBoolQuery().Must(
             elastic.NewQueryStringQuery(so.Query).
                 DefaultField("*").
                 AllFields(true),
   )

First of all. These two fields cannot be combined in a single query by default in Elasticsearch. I tried docker es containers

  • 5
  • 5.1.1
  • 5.2.2
  • 5.3.0
  • 5.4.0
  • 5.5.0
  • 5.6.0

I did not find a single version which would allow this query. My solution would be to remove the defaultField("*") option, since then it will be _all by default. Then I get some results. In ES 6 the all_fields option is deprecated.

When I try other connectors to play around (kvk, rdw, twitter) all of them seems to be broken out of the box and configs are missing. My suggestion is to provide valid configs per datasource and provide information which elasticsearch version is supported and how. For me, right now, it is costing me too much time to use it, which is a pity:)

@ksipma ksipma changed the title [query_string] query does not support [all_fields] [query_string] query does not support [all_fields] and cannot use [all_fields] parameter in conjunction with [default_field] or [fields] Mar 10, 2019
@gavofih
Copy link

gavofih commented Apr 9, 2019

Can someone make a hotfix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants