Jeroen-G/Explorer

how to add shards

asoltec opened this issue · 5 comments

'index' => [
'settings' => [
'number_of_shards' => 3,
"number_of_replicas" => 2,
],
], i try this code but not working

How would you do it without the package?

in elastic dev tool

PUT /articles
{
  "settings": {
    "number_of_shards": 3,
    "number_of_replicas": 2
  },
  "mappings": {
      "properties": {
        "body": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "id": {
          "type": "long"
        },
        "lifespan": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "period": {
          "type": "object"
        },
        "place": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "title": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
}

Ok, and where does it go wrong and how?

when i use php artisan scout:import "App/Article". it's create for me an index but index created with number_of_shards = 1 and number_of_replicas = 0 , so i want to change number_of_replicas and number_of_shards to be 3 shards and 2 replica

You should debug that and see if you can find what it tries to tell Elastic. We can work from there.