# Initial questions about elasticsearch

**URL:** <https://discuss.elastic.co/t/initial-questions-about-elasticsearch/15936>\
**Category:** Elasticsearch\
**Created:** [February 21, 2014, 12:45am UTC](https://discuss.elastic.co/t/initial-questions-about-elasticsearch/15936 "2014-02-21T00:45:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonios\_Chalkiopoul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antonios_chalkiopoul/32/1753_2.png) [@Antonios\_Chalkiopoul](https://discuss.elastic.co/u/Antonios_Chalkiopoul)\
**Post date:** [February 21, 2014, 12:45am UTC](https://discuss.elastic.co/t/initial-questions-about-elasticsearch/15936/1 "2014-02-21T00:45:46Z")

</div>

ElasticSearch is an amazing product, that i'm trying to master, but have  
some queries:

I just switched to version 1.0.0 - so the code below is run against that  
version

_1._ I start with a fresh & clean installation and try to add a mapping:

PUT infopoint/DIVER/\_mapping  
{  
"mapping" : {  
"DIVER" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"lat\_lon": true,  
"geohash": true  
},  
"image" : {"index" : "no"}  
}  
}  
}  
}

I fail with a IndexMissingException[[infopoint] missing] message

You get the idea - i want to have the location geo-hashed and i want to  
exclude the image from indexing

- so that the image is returned on a query, but matching on the image text  
should not return the document

_2._ Ok, i decide to create a infopoint/DIVER with

PUT infopoint/DIVER/123

{  
"name": "Chania Diving",  
"nameLocal": "Kαταδυτικό Χανίων",  
"image": "[http://c.commonstorage.google.com/bla/blah/](http://c.commonstorage.google.com/bla/blah/)_blah.jpg_",  
"location" : {  
"lat" : 15.5,  
"lon" : 15.1  
},  
"area1": "Crete",  
"area1Local": "Κρήτη",  
"countryCode": "GR"  
}  
After adding the first document, _then_ i i can update the mapping.

What i would like to do it set the mapping on \*/infopoint/ \*just once on a  
fresh elastic-search and have this mapping across all new /_infopoint_/  
documents

_3._ When i run a search looking for _blah.jpg_ i get a response _☹_

POST infopoint/\_search  
{  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "blah.jpg"  
}  
}  
}  
}  
}

I though i excluded the "image" from the index ☹

\*4. \*I would like to associate some _tags_ to my documents. So for example  
for the DIVER i would like to add the  
translations in Greek, Spanish etc languages... so that i can retrieve  
document even if users use a different language than english

As those 'translations' are static, i would like to attach them into the  
/infopoint/DIVER/ just once  
instead of having to transmit them every single time i index a document

Thanks a lot  
Any help or pointers to a book or tutorial will be appreciated

Antonios

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b9408a53-7fbf-45a2-950e-01d9b0edd679%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b9408a53-7fbf-45a2-950e-01d9b0edd679%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 21, 2014, 2:55am UTC](https://discuss.elastic.co/t/initial-questions-about-elasticsearch/15936/2 "2014-02-21T02:55:09Z")

</div>

1/2) There are several ways, but one way to create an index + mapping in  
one shot is:

PUT [http://localhost:9200/infopoint](http://localhost:9200/infopoint)  
{  
"mappings" : {  
"DIVER" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"lat\_lon": true,  
"geohash": true  
},  
"image" : {"index" : "no", "type": "string"}  
}  
}  
}  
}

1. There is an \_all field that is automatically introduced by ES. It  
contains a concatenation of all the field values in your JSON document.  
When you do this search:

{  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "blah.jpg"  
}  
}  
}  
}  
}

You don't specify a field, so by default it looks for "blah.jpg" in the  
\_all field, which contains the value from your image field (plus all other  
fields) which is why it matches. If you do something like this:

{  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "image:blah.jpg"  
}  
}  
}  
}  
}

Then you won't get a match if the image field is not indexed.

1. You can embed translations/tags in your document as additional fields  
but you will need to reindex the document every time you change it or any  
of its contents (such as translations/tags).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8cd43f57-7c5f-4d27-a472-ecdf573fe891%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8cd43f57-7c5f-4d27-a472-ecdf573fe891%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:48am UTC](https://discuss.elastic.co/t/initial-questions-about-elasticsearch/15936/3 "2017-07-06T01:48:29Z")

</div>

Closed on July 6, 2017, 1:48am UTC


