Rejecting mapping update to [elastic] as the final mapping would have more than 1 type: [elastic, xf]

Biarritz64

Active member
i have this error

Code:
Rejecting mapping update to [elastic] as the final mapping would have more than 1 type: [elastic, xf] in
i can't rebuid or remove search index from xf2

my cluster name "elastic"

can some one help me

how can i delete my index or cluster? try many thing can't find solution
don't know what to do?

i have latest elasticsearch 6.x v and xf2.0.9
 

Mike

XenForo developer
Staff member
I don't have a clue where "elastic" is coming from here as the cluster name shouldn't be involved.

I don't see any reason why you shouldn't be able to delete the index though. Can you provide the full stack trace of the error?
 

Biarritz64

Active member
hi @Mike
i follow @Sunka tutorial to install elasticsearch

in this steps
Code:
nano /etc/elasticsearch/elasticsearch.yml
at the end of file add this:
Code:
cluster.name: CUSTOM NAME OF YOUR CLUSTER (same name should be inserted into your XenForo field in Admin Control Panel in field Elasticsearch Index Name)
network.host: localhost
http.port: 9200
i choose "elastic" for my custom name

First i configure xfes and enter "elastic" in index name
i enable xfes and first it workes then i wanted to change the Word stemming setting in xfes and my problem start

here are the error
if i run optimise on xfes setting it return

Code:
XFES\Elasticsearch\RequestException: Rejecting mapping update to [elastic] as the final mapping would have more than 1 type: [elastic, xf] in src/addons/XFES/Elasticsearch/Api.php at line 387
XFES\Elasticsearch\Api->request() in src/addons/XFES/Elasticsearch/Api.php at line 287
XFES\Elasticsearch\Api->createIndex() in src/addons/XFES/Service/Optimizer.php at line 85
XFES\Service\Optimizer->optimize() in src/addons/XFES/Admin/Controller/EnhancedSearch.php at line 151
XFES\Admin\Controller\EnhancedSearch->actionOptimize() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1934
XF\App->run() in src/XF.php at line 333
XF::runApp() in admin.php at line 13
if i want to rebuid search index and checked remove the index
Code:
XFES\Elasticsearch\RequestException: Rejecting mapping update to [elastic] as the final mapping would have more than 1 type: [elastic, xf] in src/addons/XFES/Elasticsearch/Api.php at line 387
XFES\Elasticsearch\Api->request() in src/addons/XFES/Elasticsearch/Api.php at line 287
XFES\Elasticsearch\Api->createIndex() in src/addons/XFES/Service/Optimizer.php at line 85
XFES\Service\Optimizer->optimize() in src/addons/XFES/Search/Source/Elasticsearch.php at line 139
XFES\Search\Source\Elasticsearch->truncate() in src/XF/Search/Search.php at line 127
XF\Search\Search->truncate() in src/XF/Job/SearchRebuild.php at line 25
XF\Job\SearchRebuild->run() in src/XF/Job/Manager.php at line 241
XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 103
XF\Job\Manager->runByIds() in src/XF/Admin/Controller/Tools.php at line 120
XF\Admin\Controller\Tools->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1934
XF\App->run() in src/XF.php at line 333
XF::runApp() in admin.php at line 13
when i run
Code:
curl -XGET 'localhost:9200'
it return
Code:
  "name" : "tywki3X",
  "cluster_name" : "elastic",
  "cluster_uuid" : "BpM-rmyfT6OzwObqGJC1gA",
  "version" : {
    "number" : "6.5.4",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "d2ef93d",
    "build_date" : "2018-12-17T21:17:40.758843Z",
    "build_snapshot" : false,
    "lucene_version" : "7.5.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
thank you for your help
 
Last edited:

Biarritz64

Active member
and when i reconfigue in xfes i have this line

Code:
Index name

elastic

This index does not exist yet.
when i run
Code:
 curl -X GET "localhost:9200/_cat/indices?v"
it return
Code:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
 
Last edited:

Mike

XenForo developer
Staff member
I don't understand this comment that you quoted:
(same name should be inserted into your XenForo field in Admin Control Panel in field Elasticsearch Index Name)
That's essentially entirely unnecessary.

If you leave the index name blank, it will default to your DB name, and that should really be sufficient. Try that. Otherwise, I'm really not seeing exactly what it's picking up.
 

Biarritz64

Active member
@Mike thank you for your help
i reconfigure xfes i leave the index name blank
and it create an index with my db name
then i rebuild search cache and it workes

but if i want to change any setting in xfes the errors come back and i can't rebuid search index anymore.

i have to run
Code:
curl -XPUT 'localhost:9200/_all/_settings?pretty' -H 'Content-Type: application/json' -d '{

    "index": {

        "blocks": {

            "read_only_allow_delete": "false"

        }

    }

}'


curl -XDELETE 'localhost:9200/indexname'
if i want to change any setting
 

Mike

XenForo developer
Staff member
I think at this point, I may need you to submit a ticket with XF control panel access details and FTP or similar access so I can see exactly what command is being triggered in your situation.
 
Top