# Full text search?

**URL:** <https://discuss.elastic.co/t/full-text-search/2873>\
**Category:** Elasticsearch\
**Created:** [March 27, 2010, 11:42am UTC](https://discuss.elastic.co/t/full-text-search/2873 "2010-03-27T11:42:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![timrobertson100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timrobertson100/32/2467_2.png) [@timrobertson100](https://discuss.elastic.co/u/timrobertson100)\
**Post date:** [March 27, 2010, 11:42am UTC](https://discuss.elastic.co/t/full-text-search/2873/1 "2010-03-27T11:42:10Z")

</div>

Hey,  
I am building several thematic indexes onto the same content, but  
would like to also do a full text version.

So I might do in the marine index:

$ curl -XPUT '[http://localhost:9200/specimens/marine/1](http://localhost:9200/specimens/marine/1)' -d '  
{  
"scientificName" : "Gadus morhua",  
"collectedDate" : "2009-11-15T14:12:12",  
"commonName" : "Atlantic cod"  
}  
'

Can I simply do many2one along the lines of:

$ curl -XPUT '[http://localhost:9200/specimens/fullText/1](http://localhost:9200/specimens/fullText/1)' -d '  
{  
"terms" : {"Gadus morhua","2009-11-15T14:12:12","Atlantic cod"} //  
possibly even breaking into "Gadus" and "morhua"  
}  
'

Or is there a better way? I didn't spot anything like this scanning the docs.  
The reason I want to do this is because I want specific UI for various  
themes (which will overlap but each will be a subset of the whole),  
but still want to offer full text simple search capabilities over the  
whole store (e.g. google style)

Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 27, 2010, 12:22pm UTC](https://discuss.elastic.co/t/full-text-search/2873/2 "2010-03-27T12:22:18Z")

</div>

Hiya

> I am building several thematic indexes onto the same content, but  
> would like to also do a full text version.

> Or is there a better way? I didn't spot anything like this scanning the docs.  
> The reason I want to do this is because I want specific UI for various  
> themes (which will overlap but each will be a subset of the whole),  
> but still want to offer full text simple search capabilities over the  
> whole store (e.g. google style)

Yes, this is easy to do.

Elasticsearch stores all documents as /$index/$type/$id so you could  
have, eg

- a single index for your whole application
- multiple types, eg 'marine'

Each type can have it's own type definition, or 'mapping'  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)

When you search, you can search in a particular index, for a particular  
type. Or multiple types (or all types) in multiple indices (or all  
indices):  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)

> ï»¿  
> $ curl -XPUT '[http://localhost:9200/specimens/fullText/1](http://localhost:9200/specimens/fullText/1)' -d '  
> {  
> "terms" : {"Gadus morhua","2009-11-15T14:12:12","Atlantic cod"} //  
> possibly even breaking into "Gadus" and "morhua"  
> }  
> '

So you don't need to store anything extra - with the data you're storing  
already, it'll be sufficient. Just make sure that (eg) your scientific  
name is 'analyzed', which will allow you to search for "Gadus" and  
"morhua" separately.

Clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 27, 2010, 1:10pm UTC](https://discuss.elastic.co/t/full-text-search/2873/3 "2010-03-27T13:10:44Z")

</div>

Note also that master (0.6.0) will come with "\_all" support which means you  
can easily search on all fields. Here is the issue:

> **[Issues · elastic/elasticsearch](https://github.com/elastic/elasticsearch/issues/closed#issue/63)**
>
> Free and Open, Distributed, RESTful Search Engine. Contribute to elastic/elasticsearch development by creating an account on GitHub.

[http://github.com/elasticsearch/elasticsearch/issues/closed#issue/63](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/63)  
-shay.banon

On Sat, Mar 27, 2010 at 3:22 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hiya
> 
> > I am building several thematic indexes onto the same content, but  
> > would like to also do a full text version.
> 
> > Or is there a better way? I didn't spot anything like this scanning the  
> > docs.  
> > The reason I want to do this is because I want specific UI for various  
> > themes (which will overlap but each will be a subset of the whole),  
> > but still want to offer full text simple search capabilities over the  
> > whole store (e.g. google style)
> 
> Yes, this is easy to do.
> 
> Elasticsearch stores all documents as /$index/$type/$id so you could  
> have, eg
> 
> - a single index for your whole application
> - multiple types, eg 'marine'
> 
> Each type can have it's own type definition, or 'mapping'  
> [http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)
> 
> When you search, you can search in a particular index, for a particular  
> type. Or multiple types (or all types) in multiple indices (or all  
> indices):
> 
> [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)
> 
> > $ curl -XPUT '[http://localhost:9200/specimens/fullText/1](http://localhost:9200/specimens/fullText/1)' -d '  
> > {  
> > "terms" : {"Gadus morhua","2009-11-15T14:12:12","Atlantic cod"} //  
> > possibly even breaking into "Gadus" and "morhua"  
> > }  
> > '
> 
> So you don't need to store anything extra - with the data you're storing  
> already, it'll be sufficient. Just make sure that (eg) your scientific  
> name is 'analyzed', which will allow you to search for "Gadus" and  
> "morhua" separately.
> 
> Clint
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![timrobertson100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timrobertson100/32/2467_2.png) [@timrobertson100](https://discuss.elastic.co/u/timrobertson100)\
**Post date:** [March 28, 2010, 4:31pm UTC](https://discuss.elastic.co/t/full-text-search/2873/4 "2010-03-28T16:31:10Z")

</div>

Do I define index mappings in a JSON file?  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)  
Or do I post them to ES?

Thanks,  
Tim

On Sat, Mar 27, 2010 at 3:10 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Note also that master (0.6.0) will come with "\_all" support which means you  
> can easily search on all fields. Here is the  
> issue: [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/63)  
> -shay.banon
> 
> On Sat, Mar 27, 2010 at 3:22 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)  
> wrote:
> 
> > Hiya
> > 
> > > I am building several thematic indexes onto the same content, but  
> > > would like to also do a full text version.
> > 
> > > Or is there a better way? I didn't spot anything like this scanning the  
> > > docs.  
> > > The reason I want to do this is because I want specific UI for various  
> > > themes (which will overlap but each will be a subset of the whole),  
> > > but still want to offer full text simple search capabilities over the  
> > > whole store (e.g. google style)
> > 
> > Yes, this is easy to do.
> > 
> > Elasticsearch stores all documents as /$index/$type/$id so you could  
> > have, eg
> > 
> > - a single index for your whole application
> > - multiple types, eg 'marine'
> > 
> > Each type can have it's own type definition, or 'mapping'  
> > [http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)
> > 
> > When you search, you can search in a particular index, for a particular  
> > type. Or multiple types (or all types) in multiple indices (or all  
> > indices):
> > 
> > [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)
> > 
> > > $ curl -XPUT '[http://localhost:9200/specimens/fullText/1](http://localhost:9200/specimens/fullText/1)' -d '  
> > > {  
> > > "terms" : {"Gadus morhua","2009-11-15T14:12:12","Atlantic cod"} //  
> > > possibly even breaking into "Gadus" and "morhua"  
> > > }  
> > > '
> > 
> > So you don't need to store anything extra - with the data you're storing  
> > already, it'll be sufficient. Just make sure that (eg) your scientific  
> > name is 'analyzed', which will allow you to search for "Gadus" and  
> > "morhua" separately.
> > 
> > Clint
> > 
> > --  
> > Web Announcements Limited is a company registered in England and Wales,  
> > with company number 05608868, with registered address at 10 Arvon Road,  
> > London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 28, 2010, 5:27pm UTC](https://discuss.elastic.co/t/full-text-search/2873/5 "2010-03-28T17:27:00Z")

</div>

You use the put\_mapping API in order to post mappings to elasticsearch:  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/admin/indices/put\_mapping/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/admin/indices/put_mapping/).  
Note, you can always just post a json document and mappings will be  
automatically created for it with default settings.

-shay.banon

On Sun, Mar 28, 2010 at 7:31 PM, Tim Robertson [timrobertson100@gmail.com](mailto:timrobertson100@gmail.com)wrote:

> Do I define index mappings in a JSON file?  
> [http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)  
> Or do I post them to ES?
> 
> Thanks,  
> Tim
> 
> On Sat, Mar 27, 2010 at 3:10 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Note also that master (0.6.0) will come with "\_all" support which means  
> > you  
> > can easily search on all fields. Here is the  
> > issue:  
> > [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/63)  
> > -shay.banon
> > 
> > On Sat, Mar 27, 2010 at 3:22 PM, Clinton Gormley \<  
> > [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)\>  
> > wrote:
> > 
> > > Hiya
> > > 
> > > > I am building several thematic indexes onto the same content, but  
> > > > would like to also do a full text version.
> > > 
> > > > Or is there a better way? I didn't spot anything like this scanning  
> > > > the  
> > > > docs.  
> > > > The reason I want to do this is because I want specific UI for various  
> > > > themes (which will overlap but each will be a subset of the whole),  
> > > > but still want to offer full text simple search capabilities over the  
> > > > whole store (e.g. google style)
> > > 
> > > Yes, this is easy to do.
> > > 
> > > Elasticsearch stores all documents as /$index/$type/$id so you could  
> > > have, eg
> > > 
> > > - a single index for your whole application
> > > - multiple types, eg 'marine'
> > > 
> > > Each type can have it's own type definition, or 'mapping'  
> > > [http://www.elasticsearch.com/docs/elasticsearch/mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/)
> > > 
> > > When you search, you can search in a particular index, for a particular  
> > > type. Or multiple types (or all types) in multiple indices (or all  
> > > indices):
> 
> [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)
> 
> > > > $ curl -XPUT '[http://localhost:9200/specimens/fullText/1](http://localhost:9200/specimens/fullText/1)' -d '  
> > > > {  
> > > > "terms" : {"Gadus morhua","2009-11-15T14:12:12","Atlantic cod"} //  
> > > > possibly even breaking into "Gadus" and "morhua"  
> > > > }  
> > > > '
> > > 
> > > So you don't need to store anything extra - with the data you're storing  
> > > already, it'll be sufficient. Just make sure that (eg) your scientific  
> > > name is 'analyzed', which will allow you to search for "Gadus" and  
> > > "morhua" separately.
> > > 
> > > Clint
> > > 
> > > --  
> > > Web Announcements Limited is a company registered in England and Wales,  
> > > with company number 05608868, with registered address at 10 Arvon Road,  
> > > London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:25am UTC](https://discuss.elastic.co/t/full-text-search/2873/6 "2017-07-06T04:25:02Z")

</div>

Closed on July 6, 2017, 4:25am UTC


