Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add shards #240

Open
asoltec opened this issue Apr 14, 2024 · 5 comments
Open

how to add shards #240

asoltec opened this issue Apr 14, 2024 · 5 comments

Comments

@asoltec
Copy link

asoltec commented Apr 14, 2024

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

@Jeroen-G
Copy link
Owner

How would you do it without the package?

@asoltec
Copy link
Author

asoltec commented Apr 15, 2024

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
            }
          }
        }
      }
    }
}

@Jeroen-G
Copy link
Owner

Ok, and where does it go wrong and how?

@asoltec
Copy link
Author

asoltec commented Apr 15, 2024

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

@Jeroen-G
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants