Explanation of research method between ES 5.X and 6.X

Hello everyone,

I have updated my ElasticSearch 5.x to 6.x, and the discovery Search have not the same result. In 5.x, i have 500 results when searching in my index, and 9 results in 6.x.

Can someone explain me the new research method of 6.X ES, and the difference between 5.X and 6.X.

I have read many documents, but i can't find the answer.

Thanks you very much.


What does you search look like? What does your mappings look like?

Hello, thanks for the answer.

I write "Star" for example, but between 5.x and 6.x, i don't have number of results.

I have many fields, which represent's company's information.

This is my mapping :

"mappings": {
"doc": {
"properties": {
"SIREN": { "type": "keyword" },
"NIC": { "type": "keyword" },
"NOMPRIN": { "type": "keyword" },
"NOMCOMP": { "type": "keyword" },
"ADRESSE1": { "type": "keyword" },
"ADRESSE2": { "type": "keyword" },
"ADRESSE3": { "type": "keyword" },
"CODPOSTCOMP": { "type": "keyword" },
"NUMVOIE": { "type": "keyword" },
"TYPVOIE": { "type": "keyword" },
"LIBVOIE": { "type": "keyword" },
"CODPOS": { "type": "keyword" },
"CEDEX": { "type": "keyword" },
"CODEREG": { "type": "keyword" },
"LIBREG": { "type": "keyword" },
"CODEDEP": { "type": "keyword" },
"CODECOM": { "type": "keyword" },
"LIBCOM": { "type": "keyword" },
"NOM": { "type": "keyword" },
"PRENOM": { "type": "keyword" },
"INSEESIEGE": { "type": "keyword" },
"INSEE": { "type": "keyword" },
"NATJUR": { "type": "keyword" },
"CODENAF": { "type": "keyword" },
"LIBNAF": { "type": "keyword" },
"TRANCHEEFFE": { "type": "keyword" },
"EFFECTIF": { "type": "integer" },
"CATEGORIE": { "type": "keyword" },
"regionIsoCode": { "type": "keyword" },
"ZONEBLANCHE": { "type": "keyword" },
"POPULATIONCOM": { "type": "integer" }

Elasticsearch 5.x had an _all field that was enabled by default, which allowed case-insensitive free-text search. This could take up a lot of space on disk and was in Elasticsearch 6.x removed and replaced by an all_fields option for the query string, which Kibana falls back on when no fields are specified in the search bar. This instead queries all fields, and since most of your fields are mapped as keyword(case sensitive) the search behaviour is now different.

If you want the old behaviour and do not mind indices taking upon more space on disk, you can create your own _all field equivalent using the copy_to functionality.

Thanks a lot !

I will try to do this.

Do you know the command to specify fields in the search bar ? Thanks

Something like: NOMPRIN:sarl

But as Christian said you need to change the mapping to make that work.

Thanks Dadoonet.

I have another problem.

In 5.x when i write "STAR'S", i have many match.
In 6.X, i have some match, but not with the '. Maybe is considered as an operator ?

Thanks for help.

You should look at the _analyze API. It will basically help you to understand how your text is processed before getting indexed.

I don't think so.
If you need help on that, please share what you are exactly doing. I mean a simple example with the real mapping and real document and query would help.

A full recreation script as described in About the Elasticsearch category would help. Please, try to keep the example as simple as possible.

Thanks :smiley:

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