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

Deprecated field [include] used, expected [includes] instead #1769

Closed
adiloztaser opened this issue May 12, 2020 · 4 comments · Fixed by #1788
Closed

Deprecated field [include] used, expected [includes] instead #1769

adiloztaser opened this issue May 12, 2020 · 4 comments · Fixed by #1788
Assignees
Labels

Comments

@adiloztaser
Copy link
Contributor

Describe the bug
When I was working on the user integration feature in our project, I realized that Elasticsearch returns this warning. I am not quite sure but include deprecated in Elasticsearch 6.6.0 (Deprecate _source_include and _source_exclude url parameters #33475).

I think the warning will be solved when if we replace include with includes.

Here is my simple user query:

$users = new WP_User_Query( array(
	'search'        => $name,
	'search_fields' => array( 'display_name' ),
	'fields'        => array( 'ID', 'display_name' ),
	'number'        => $number,
	'offset'        => $offset,
	'ep_integrate'  => true
) );
Elasticsearch query which returns warning
{
  "from": 0,
  "size": 20,
  "_source": {
    "include": [
      "ID",
      "display_name"
    ]
  },
  "query": {
    "bool": {
      "should": [
        {
          "multi_match": {
            "query": "Nefis Yemek Tarifleri",
            "type": "phrase",
            "fields": [
              "display_name"
            ],
            "boost": 4
          }
        },
        {
          "multi_match": {
            "query": "Nefis Yemek Tarifleri",
            "fields": [
              "display_name"
            ],
            "boost": 2,
            "fuzziness": 0,
            "operator": "and"
          }
        },
        {
          "multi_match": {
            "fields": [
              "display_name"
            ],
            "query": "Nefis Yemek Tarifleri",
            "fuzziness": 1
          }
        }
      ]
    }
  },
  "sort": [
    {
      "user_login.raw": {
        "order": "asc"
      }
    }
  ]
}

Here is the whole warning line:
[2020-05-12T09:54:33,143][WARN ][o.e.d.c.ParseField ] Deprecated field [include] used, expected [includes] instead

Environment information

  • WordPress version: 5.3.3
  • ElasticPress version: 3.4.1
  • Elasticsearch version: 6.3.2
@dinhtungdu
Copy link
Contributor

@adiloztaser I addressed this issue in #1788. If you have time, can you please test and review it?

@adiloztaser
Copy link
Contributor Author

Hi @dinhtungdu,

The pr fixes my problem, but I did not test any other Elasticsearch versions which are older than 6.3.2. Do you know the older Elasticsearch versions support the includes field? If they do not support there may be a problem.

@dinhtungdu
Copy link
Contributor

@adiloztaser I tested with ES 5.6.16 and it works without any warning. The docs for ES 5.0 and above shows includes example too.

@adiloztaser
Copy link
Contributor Author

@dinhtungdu thanks for the information and your work 👍

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

Successfully merging a pull request may close this issue.

2 participants