# Moving From 1.7.5 to 7.10.2 - DLS Changes

**URL:** <https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235>\
**Category:** Elasticsearch\
**Created:** [June 29, 2024, 12:04am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235 "2024-06-29T00:04:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 12:04am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/1 "2024-06-29T00:04:34Z")

</div>

I've used an ancient (1.7.5) version of Elasticsearch for years and it's been great. The initial setup was a bit difficult, but when completed it has always been rock solid.

Unfortunately my Elasticsearch provider wants me to upgrade or pay an exorbitant amount to keep using 1.7.5.

So, here's an example of what I have to upgrade, which works perfectly in 1.7.5 but gives an "Unknown key for a START\_OBJECT in [filter]." error.

Basically I'm trying to figure out why this is happening and what changes to the DSL am I missing in 7.10.2 to trigger this error.

Any help would be much appreciated.

The query:

```auto
{
		query: {
		multi_match: {
			query: q, fields: ['title^10', 'body']
		},

		},
		filter: {
		bool:{
			must: [
				{term: {root_comment: true}},
				{term: {soft_delete: false}},
				{term: {is_draft: false}},
				{term: {"sub.is_private": {value: false}}},
				{term: {"sub.is_banned": {value: false}}},
				{term: {"sub.nsfw": false}}
			]
		}	
	},
	"sort": [
		{ "posted": { "order": "desc" }},
		{ "_score": { "order": "desc" }}
	],
	from: start,
	size: limit
}

```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:39am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/2 "2024-06-29T00:39:01Z")

</div>

As you are making such a large leap in versions I do not see the point in going to a version that is also very old and have been EOL a long time. I would recommend going all the way to the very latest Elasticsearch 8 release as that likely will save you a lot of time and effort as version 7.10 may be dropped soon too.

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 12:40am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/3 "2024-06-29T00:40:49Z")

</div>

I hear you, but basically the last Open Source version is 7.10.2 and it's the difference between $9/mo and $30.

Basically I'm on Heroku and it's an add on...which is kind of the whole problem.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:43am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/4 "2024-06-29T00:43:18Z")

</div>

What is the mapping for the fields you are querying? Looks like Boolean, but would like to make sure. It would probably help if you could create a minimal complete example that highlights the issue and can be run in Kibana console.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:50am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/5 "2024-06-29T00:50:34Z")

</div>

> [@djfrodo](#):
>
> ```auto
> {term: {is_draft: false}},
> {term: {"sub.is_private": {value: false}}},
> 
> ```

Why are these different? Should this not be:

> [@djfrodo](#):
>
> ```auto
> {term: {is_draft: false}},
> {term: {"sub.is_private": false}},
> 
> ```

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 12:51am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/6 "2024-06-29T00:51:39Z")

</div>

This is a Ruby on Rails app, so I'm just using the elasticsearch, elasticsearch-model, and elasticsearch-rails GEMs. Therefore I've never had to map anything - it just worked. Basically the all of the fields are properties of Ruby objects that Rails then saves in Elastic. So, "title", "body", "root\_comment", etc. are all columns in postgres in the "comments" table, which get saved to Elastic when a comment is created.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:53am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/7 "2024-06-29T00:53:44Z")

</div>

I am not a Ruby developer so am not familiar with that. I can only help if the example is in API calls instead of using client libraries.

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 12:54am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/8 "2024-06-29T00:54:08Z")

</div>

Sorry, yeah, you're right. But see my other comment - this is coming from a Rails app, so the code may have remnants of that. The extra } is from that...

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:55am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/9 "2024-06-29T00:55:12Z")

</div>

Then you will need to wait for someone familiar with that client library to respond. Have you upgraded the client library to a version compatible with Elasticsearch 7.10?

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 12:57am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/10 "2024-06-29T00:57:28Z")

</div>

Yes, I'm running it locally and also with the provider, both on 7.10.2.

So I can use curl locally with just basic Elasticsearch queries, like the one I posted.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2024, 12:58am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/11 "2024-06-29T00:58:43Z")

</div>

Then revise the query as per my comments and try it through curl and see if that resolves the issue or at least gives a different error message.

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 1:04am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/12 "2024-06-29T01:04:21Z")

</div>

Yeah I have. Basically it returns the entire index and then says:

```auto
query:: command not found
multi_match:: command not found
query:: command not found
},: command not found
},: command not found
bool:{: command not found
Command 'filter:' not found, did you mean:
  command 'filter' from deb filter (2.6.3+ds1-3)
  command 'filterm' from deb konwert (1.8-13.2)
Try: sudo apt install <deb name>
{term:: command not found
{term:: command not found
{term:: command not found
{term:: command not found
{term:: command not found
{term:: command not found
},: command not found

```

I have rewritten it and it "worked" in that it returned search both in curl and in the app, but the results were wrong due to the order. Basically using bool, then must, and then the multi\_match.

What I'm saying here is I think, can't be sure, that the DSL was changed and I don't understand where.

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 1:07am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/13 "2024-06-29T01:07:13Z")

</div>

Here's the example that I used for the basis of my query that "worked".

Unfortunately I blew my version away, but the point is the order - while it works it doesn't do the same logic.

```auto
def self.search(query, genre = nil)
    params = {
      query: {
        bool: {
          must: [
            {
              multi_match: {
                query: query, 
                fields: [:title, :artist, :lyrics] 
              }
            },
          ],
          filter: [
            {
              term: { genre: genre }
            }
          ]
        }
      }
    }

    self. __elasticsearch__.search(params)
  end

```

---

<div class="post-metadata">

**Author:** ![djfrodo](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@djfrodo](https://discuss.elastic.co/u/djfrodo)\
**Post date:** [June 29, 2024, 1:42am UTC](https://discuss.elastic.co/t/moving-from-1-7-5-to-7-10-2-dls-changes/362235/14 "2024-06-29T01:42:07Z")

</div>

Here's the query that "works" but doesn't have the same logic.

```auto
query: {
		bool:{
			must: [
				{

		multi_match: {
			query: q, fields: ['title^10', 'body']
		}
				},

				],
		filter: [
				{term: {root_comment: true}},
				{term: {soft_delete: false}},
				{term: {is_draft: false}},
				{term: {"sub.is_private": {value: false}}},
				{term: {"sub.is_banned": {value: false}}},
				{term: {"sub.nsfw": false}}
		]
	}
	},
	"sort": [
		{ "posted": { "order": "desc" }},
		{ "_score": { "order": "desc" }}
	],
	from: start,
	size: limit
}

```
