Elastica icon indicating copy to clipboard operation
Elastica copied to clipboard

Migration 2.8 to 5.3 Help!

Open EliuFlorez opened this issue 6 years ago • 5 comments

Hello! I'm new to elasticSearch and I'm migrating "elastic" from 2.8 to 5.3.3 if I'm having a hard time switching filtered (), filter () to a filter query. if you have a migration tutorial it would be fantastic if not a little help thanks.

`$qB = new QueryBuilder();

$query = $qB->query()->match_all();

$filter = $qB->filter()->bool() ->addMust($qB->filter()->type('article')) ->addMust($qB->filter()->term(['status' => true]));

$finalQuery = $qB->query()->filtered($query, $filter);`

Please help!

EliuFlorez avatar Jan 25 '19 15:01 EliuFlorez

There is no version 2.8? For example queries best have a look at the Elastica testsuite.

ruflin avatar Jan 30 '19 08:01 ruflin

@ruflin is that I do not know much about the migration process from v2.x to v5.x. so I asked for your help to change just that consult the new version. if it would be so kind on your part. I know it is not your job but to whom I could ask more than the project leader. : D

EliuFlorez avatar Feb 01 '19 19:02 EliuFlorez

I think we need a bit more background here. What is the Exact version of Elastica you are using and want to use and the same for Elasticsearch. Do you already have a plan on the Elasticsearch migration? In any case have a look at https://www.elastic.co/guide/en/elasticsearch/reference/5.2/setup-upgrade.html

ruflin avatar Feb 06 '19 10:02 ruflin

@ruflin if the version of elasticSearch is vs2.3.4 and the elastic version is 3.2.3 which I want to migrate to elasticSearch 5.x and elastic 5.x

Like the filter script migration: $ elasticFilter = $ qB-> filter () -> script ($ script); they are questions that I would like to help me since I am a newbie with elasticSearch

EliuFlorez avatar Feb 06 '19 18:02 EliuFlorez

Basically everything has become a query, so you need to convert you filters to queries. See here for some bool examples: https://github.com/ruflin/Elastica/blob/master/test/Elastica/Query/BoolQueryTest.php

ruflin avatar Feb 07 '19 10:02 ruflin