I create user login system with file uploading , and user can upload unlimited textfiles and search word, how to create and mapping index this case?

Welcome.

What are you asking for?
Just pasting a link here to another platform won't help IMO.

hi,
i try to create user login system with file uploading option,
user can upload unlimited textfiles in his account, then search particular word is avilable or not in his uploaded file this is my task.
i store each file is a document in ES index, the problem is incase the index reach max size how can i handle that

EX: this is my mapping of index

PUT _index_template/userdoc_template
{
"index_patterns": ["userdoc-*"],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "userfile-policy",
"index.lifecycle.rollover_alias": "userdoc"
},
"mappings" : {
"properties" : {
"email" : {"type" : "keyword"},
"filename" : {"type" : "keyword"},
"filedata" : {"type" : "text"}
}
}
}
}
PUT userdoc-000001
{
"aliases": {
"userdoc": {
"is_write_index": true
}
}
}

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

I believe you are talking about Index Lifecycle Management, right?
What exactly would you like to "handle"?

if user search any random word , the search operation is searched word in every index, in case my index has more then 50 index and every index has 1million document , i think that case search is not efficient in my way...,could you please suggest any other way for archive my problem

PUT _index_template/userdoc_template
{
  "index_patterns": ["userdoc-*"],                 
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 1,
      "index.lifecycle.name": "userfile-policy",      
      "index.lifecycle.rollover_alias": "userdoc"    
    },
    "mappings" : {
      "properties" : {
        "email" : {"type" : "keyword"},
        "filename" : {"type" : "keyword"},
        "filedata" : {"type" : "text"}
      }
    }
  }
}
PUT userdoc-000001
{
  "aliases": {
    "userdoc": {
      "is_write_index": true
    }
  }
}

Why do you think it's not efficient?

my document is located in index-00001 why is search remining index? that is my problem
give me any suggestion for there any changes need to be done it will make more faster searching

How much slow it is today?
What does a search query look like?
What is the response?

now its work fine , but in future my user base is more then 5million every user can upload many files everyday and search word that time the search will take some time right? so there is any way to avoid that search delay?

and next question : now i store textfile to directly ES databse in string format, is it right? or any other way store textfile and search it and any operation on file

EX : search query

GET userdoc/_search
{
  "query": { 
    "bool": { 
      "must": [
        { 
          "match": { "filedata": "like"        }
          
        }
      ],
      "filter": [ 
        { 
          "term":  { "email": "arun@gmail.com" }
          
        }
      ]
      
    }
  }
}
 

This should be fast enough even with a lot of documents.

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