'fielddata_fields' to 'docvalue_fields' in 6.x problems


(Kishan Sojitra) #1

As per log of breaking changes in elasticsearch 6.x, fielddata_fields is now deprecated.
I'm trying to change my NEST DSL query to run it in newer version but I can not find docvalue_fields in the place of fielddata_fields. Can anyone help please!!!

Here is my NEST DSL Query:

lESResponse = lESClient.Search<indexMapping>(s => s
                                            .Size(10000)
                                            .Query(desQuery1 => desQuery1
                                                .Bool(b => b
                                                    .Must(m => m
                                                            .Terms(t => t
                                                                .Field("_uid")
                                                                .Terms(pUIDArray)),
                                                            m => m
                                                            .Nested(n => n
                                                                .Path("bookData")
                                                                .InnerHits(ih => ih
                                                                    .Source(false)
                                                                    .FielddataFields("bookData.data.keyWords", "bookData.isCellData", "bookData.rOffset", "bookData.cOffset", "bookData.address")
                                                                    .Size(pInnerHitSize)
                                                                    .From(pStartFrom))
                                                                .Query(q => q
                                                                    .Bool(b1 => b1
                                                                        .Must(m1 => m1
                                                                            .QueryString(qs => qs
                                                                                .DefaultOperator(lOperator)
                                                                                .Query(pSearchTerm)
                                                                                .DefaultField("bookData.data"))))))))));

You can find FielddataFields under Nested query. I want docvalue_fields there to execute this query in elasticsearch 6.x.

Thanks in advance.


(Thiago Souza) #2

What is the version of NEST that you are using?


(Kishan Sojitra) #3

Thanks for the reply @thiago!

I'm using NEST 6.0.0.0 rc version. Which I have downloaded form https://www.nuget.org/packages/NEST/6.0.0-rc1.


(Thiago Souza) #4

Hey there. Thanks for for reporting this. The fielddata_fields indeed has been renamed in Elasticsearch since 5.0 but NEST didn't follow up. Apparently, it has been removed from master but docvalue_fields has not been added.

I opened an issue https://github.com/elastic/elasticsearch-net/issues/3017


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.