# Creating type in ES

**URL:** <https://discuss.elastic.co/t/creating-type-in-es/308666>\
**Category:** Elasticsearch\
**Created:** [July 1, 2022, 1:43pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666 "2022-07-01T13:43:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 1, 2022, 1:43pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/1 "2022-07-01T13:43:11Z")

</div>

Hello ,  
I am new to Elasticsearch. I have created index.  
And Now adding type and document.  
But getting error.  
{"error":"no handler found for uri [/my\_first\_index/message] and method [POST]"}  
Entering this command  
curl -XPOST "[http://localhost:9200/my\_first\_index/message](http://localhost:9200/my_first_index/message)" -d'{"text":"Hello World!"}'

Please share any configuration setting if needed.  
Please help.

Thank you

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 1, 2022, 3:09pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/2 "2022-07-01T15:09:32Z")

</div>

Hi @smitak Welcome to the community.

First you should read this [Removal of Types](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html) in detail.

Summary : there is no more setting the field `_type` to anything other than `_doc` if you want to indicate a type for a document then you would simply add your own type field

example

```auto
POST /my_first_index/_doc
{
  "type" : "message",
  "text": "Hello World!"
}

curl -XPOST "http://localhost:9200/my_first_index/_doc" -d'{"type":"message","text":"Hello World!"}'

```

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 6, 2022, 11:41am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/3 "2022-07-06T11:41:48Z")

</div>

Hello Sir,  
Thanks a lot for reply.  
I want to search keywords like php,java in pdf files(Files are stored in a folder.)  
Can you please suggest what is the procedure.  
I have created index and converted the pdf file to base64 format. But cant do search.  
Please reply.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 6, 2022, 12:58pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/4 "2022-07-06T12:58:26Z")

</div>

Can we index a pdf file or folder of files in ES and how?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 6, 2022, 1:20pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/5 "2022-07-06T13:20:31Z")

</div>

You can have a look at FSCrawler project which does that.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 6, 2022, 1:27pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/6 "2022-07-06T13:27:59Z")

</div>

Thank you Sir for reply.  
Can you please share a link of any example.  
And i am using elasticsearch-7.17.0 And integrating in Codeigniter Project.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 6, 2022, 3:30pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/7 "2022-07-06T15:30:45Z")

</div>

[https://fscrawler.readthedocs.io/en/latest/](https://fscrawler.readthedocs.io/en/latest/)

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 6:29am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/8 "2022-07-07T06:29:37Z")

</div>

Thank you so much sir. I will check and get back to you.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 7:12am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/9 "2022-07-07T07:12:02Z")

</div>

Hello Sir,  
I have downloaded and now configured.  
As per documentation i am changing the url in \_setting.yml file  
url :"D:\resumes" in which i have stored the sample resume pdf files for testing but it is giving error.  
Please reply .

12:36:53,418 INFO [f.p.e.c.f.c.BootstrapChecks] Memory [Free/Total=Percent]: HEAP [99.2mb/1.9gb=5.0%], RAM [448.3mb/7.7gb=5.65%], Swap [4.6gb/19.2gb=24.08%].  
12:36:53,588 INFO [f.p.e.c.f.FsCrawlerImpl] Starting FS crawler  
12:36:53,588 INFO [f.p.e.c.f.FsCrawlerImpl] FS crawler started in watch mode. It will run unless you stop it with CTRL+C.  
12:36:53,951 INFO [f.p.e.c.f.c.ElasticsearchClient] Elasticsearch Client connected to a node running version 7.17.0  
12:36:53,968 INFO [f.p.e.c.f.c.ElasticsearchClient] Elasticsearch Client connected to a node running version 7.17.0  
esumes] every [15m][f.p.e.c.f.FsParserAbstract] FS crawler started for [resumes] for [D:  
esumes doesn't exists.p.e.c.f.FsParserAbstract] Error while crawling D:

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 7:27am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/10 "2022-07-07T07:27:58Z")

</div>

Hello Sir,  
I have changed `D:\resumes` to `D:\\resumes` and it works.My pdf files are indexed.  
Thank you so much . I want to search in that files how to do that?  
And one more help Now How to integrate in CI ?

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 7:36am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/11 "2022-07-07T07:36:28Z")

</div>

Searching also done using the GET command.  
Now I have ElasticSearch library in codeigniter and I have created sample index through that. But it was before FSCrawler . Now what i need to do for implement in CI. Please help.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2022, 9:45am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/12 "2022-07-07T09:45:38Z")

</div>

I don't understand what do you mean by CI integration.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 9:45am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/13 "2022-07-07T09:45:44Z")

</div>

Finally I have done Sir. Thank you so much for your quick reply.  
Its easy through FSCrawler.  
Thank you so much.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 7, 2022, 11:55am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/14 "2022-07-07T11:55:53Z")

</div>

Now I want to search in file contents only . Can you please tell me how to write query in kibana.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2022, 1:55pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/15 "2022-07-07T13:55:07Z")

</div>

Something like that:

```auto
GET /indexname/_search
{
   "query": {
     "match": {
       "content": "text you are searching for"
     }
   }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2022, 1:56pm UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/16 "2022-07-07T13:56:56Z")

</div>

But if you are looking to a complete User Interface for end users, I'd recommend using Workplace Search ([Workplace Search settings — FSCrawler 2.10-SNAPSHOT documentation](https://fscrawler.readthedocs.io/en/latest/admin/fs/wpsearch.html)). It comes with a full UI.

I did a demo of this recently at: [https://speaker.pilato.fr/64HZzX/indexing-your-office-documents-with-elastic-stack-and-fscrawler](https://speaker.pilato.fr/64HZzX/indexing-your-office-documents-with-elastic-stack-and-fscrawler)

[![](https://us1.discourse-cdn.com/elastic/original/3X/c/e/ce8e5db58d22ec7aa32e7e9a86cc127d6789fc2d.jpeg "Indexing your office documents with Elastic stack and FSCrawler | David Pilato @ Elastic") ](https://www.youtube.com/watch?v=D6dpQ-avd0g)

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 8, 2022, 7:29am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/17 "2022-07-08T07:29:57Z")

</div>

Yes sir I have done it.  
Thanks a lot.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 8, 2022, 11:22am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/18 "2022-07-08T11:22:39Z")

</div>

yes sir . I will look into it.  
I want to add boolean query for search keywords now.

Thank you So much.

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 11, 2022, 9:34am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/19 "2022-07-11T09:34:49Z")

</div>

Hello sir ,  
How i can fetch only file names from result array of search?

---

<div class="post-metadata">

**Author:** ![smitak](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@smitak](https://discuss.elastic.co/u/smitak)\
**Post date:** [July 12, 2022, 9:28am UTC](https://discuss.elastic.co/t/creating-type-in-es/308666/21 "2022-07-12T09:28:55Z")

</div>

I want to say that i am integrating Elasticsearch in Codeigniter.  
But Using the Elasticsearch Codeigniter library I have done it.

[Next page](https://discuss.elastic.co/t/creating-type-in-es/308666.md?page=2)
