# Dynamic data into Name Suggester

**URL:** <https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285>\
**Category:** Elasticsearch\
**Created:** [January 17, 2014, 1:29am UTC](https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285 "2014-01-17T01:29:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Kalra](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@Rahul\_Kalra](https://discuss.elastic.co/u/Rahul_Kalra)\
**Post date:** [January 17, 2014, 1:29am UTC](https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285/1 "2014-01-17T01:29:01Z")

</div>

Hi,  
I am pretty new to Elastic Search, please help me find out how can I use  
name\_suggest on the data which I capture from ldap river.

I am trying to put the value of _first name_ and _last name_ fetched from  
ldap river directly to _name\_suggest_ input so that these can be used in  
suggestions.

_Step 1_. Created index with name\_suggestor

curl -X PUT localhost:9200/ldapdata4 -d '  
{  
"mappings": {  
"persons1" : {  
"properties" : {  
"dsId" : { "type" : "string" },  
"firstName" : { "type" : "string" },  
"lastName" : { "type" : "string" },  
"name\_suggest" : {  
"type" : "completion"  
}  
}  
}  
}  
}'

Checked the mapping created by running :  
[http://localhost:9200/ldapdata4/\_mapping](http://localhost:9200/ldapdata4/_mapping)

{  
"ldapdata4": {  
"persons1": {  
"properties": {  
"dsId": {  
"type": "string"  
},  
"firstName": {  
"type": "string"  
},  
"lastName": {  
"type": "string"  
},  
"name\_suggest": {  
"type": "completion",  
"analyzer": "simple",  
"payloads": false,  
"preserve\_separators": true,  
"preserve\_position\_increments": true,  
"max\_input\_len": 50  
},  
}  
}  
}  
}

## \*Step 2: \*Restarted the elastic search instance and it fetched the data from ldap.

curl -XPUT 'localhost:9200/\_river/my\_ldap\_river1/\_meta' -d '{  
"type" : "ldap",  
"ldap" : {  
"host" : "[lookup-uat.mycomp.com](http://lookup-uat.mycomp.com)",  
"userDn" : "",  
"credentials" : "",  
"baseDn" : "ou=people,o=mycomp",  
"filter" : "(objectClass=person)",  
"poll" : "86400s",  
"scope" : "subtree",  
"attributes" : [  
"mycompDSID",  
"mycompDSID",  
"givenName",  
"mycompLastName",  
],  
"fields" : [  
"\_id",  
"dsId",  
"firstName",  
"lastName"  
],

- "name\_suggest" : {\*
- 

```
"input" : ["firstName",*

```

- 

```
    "lastName"*

```

- 

```
     ]*

```

- }\*  
},  
"index" : {  
"index" : "ldapdata4",  
"type" : "persons1"  
}  
}'

* * *

_Step 3: Checked the data inserted and found name\_suggestor is not  
populated_  
[http://localhost:9200/ldapdata4/\_search?pretty=true&q=](http://localhost:9200/ldapdata4/_search?pretty=true&q=)_:_

{  
"took" : 3,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 4,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "ldapdata4",  
"\_type" : "persons1",  
"\_id" : "143",  
"\_score" : 1.0, "\_source" :  
{"lastName":["babot","babbott"],"firstName":"Aarun"}  
}, {  
"\_index" : "ldapdata4",  
"\_type" : "persons1",  
"\_id" : "93",  
"\_score" : 1.0, "\_source" :  
{"lastName":"sacskerson","firstName":"test"}  
}

Please help me, how to put the dynamic data into name suggester.

--  
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/d022942a-479b-43e9-83c0-8dbb9eeb8208%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d022942a-479b-43e9-83c0-8dbb9eeb8208%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:** ![Rahul\_Kalra](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@Rahul\_Kalra](https://discuss.elastic.co/u/Rahul_Kalra)\
**Post date:** [January 17, 2014, 7:39pm UTC](https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285/2 "2014-01-17T19:39:36Z")

</div>

On Thursday, January 16, 2014 5:29:01 PM UTC-8, Rahul Kalra wrote:

> Hi,  
> I am pretty new to Elastic Search, please help me find out how can I use  
> name\_suggest on the data which I capture from ldap river.
> 
> I am trying to put the value of _first name_ and _last name_ fetched from  
> ldap river directly to _name\_suggest_ input so that these can be used in  
> suggestions.
> 
> _Step 1_. Created index with name\_suggestor
> 
> curl -X PUT localhost:9200/ldapdata4 -d '  
> {  
> "mappings": {  
> "persons1" : {  
> "properties" : {  
> "dsId" : { "type" : "string" },  
> "firstName" : { "type" : "string" },  
> "lastName" : { "type" : "string" },  
> "name\_suggest" : {  
> "type" : "completion"  
> }  
> }  
> }  
> }  
> }'
> 
> Checked the mapping created by running :  
> [http://localhost:9200/ldapdata4/\_mapping](http://localhost:9200/ldapdata4/_mapping)
> 
> {  
> "ldapdata4": {  
> "persons1": {  
> "properties": {  
> "dsId": {  
> "type": "string"  
> },  
> "firstName": {  
> "type": "string"  
> },  
> "lastName": {  
> "type": "string"  
> },  
> "name\_suggest": {  
> "type": "completion",  
> "analyzer": "simple",  
> "payloads": false,  
> "preserve\_separators": true,  
> "preserve\_position\_increments": true,  
> "max\_input\_len": 50  
> },  
> }  
> }  
> }  
> }
> 
> \*Step 2: \*Restarted the Elasticsearch instance and it fetched the data  
> from ldap.
> 
> * * *
> 
> curl -XPUT 'localhost:9200/\_river/my\_ldap\_river1/\_meta' -d '{  
> "type" : "ldap",  
> "ldap" : {  
> "host" : "[lookup-uat.mycomp.com](http://lookup-uat.mycomp.com)",  
> "userDn" : "",  
> "credentials" : "",  
> "baseDn" : "ou=people,o=mycomp",  
> "filter" : "(objectClass=person)",  
> "poll" : "86400s",  
> "scope" : "subtree",  
> "attributes" : [  
> "mycompDSID",  
> "mycompDSID",  
> "givenName",  
> "mycompLastName",  
> ],  
> "fields" : [  
> "\_id",  
> "dsId",  
> "firstName",  
> "lastName"  
> ],
> 
> - "name\_suggest" : {\*
> - 
> 
> ```
> "input" : ["firstName",*
> 
> ```
> 
> - 
> 
> ```
> "lastName"*
> 
> ```
> 
> - 
> 
> ```
> ]*
> 
> ```
> 
> - }\*  
> },  
> "index" : {  
> "index" : "ldapdata4",  
> "type" : "persons1"  
> }  
> }'
> 
> * * *
> 
> _Step 3: Checked the data inserted and found name\_suggestor is not  
> populated_  
> [http://localhost:9200/ldapdata4/\_search?pretty=true&q=\*:](http://localhost:9200/ldapdata4/_search?pretty=true&q=*:)\*
> 
> {  
> "took" : 3,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 4,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "ldapdata4",  
> "\_type" : "persons1",  
> "\_id" : "143",  
> "\_score" : 1.0, "\_source" :  
> {"lastName":["babot","babbott"],"firstName":"Aarun"}  
> }, {  
> "\_index" : "ldapdata4",  
> "\_type" : "persons1",  
> "\_id" : "93",  
> "\_score" : 1.0, "\_source" :  
> {"lastName":"sacskerson","firstName":"test"}  
> }
> 
> Please help me, how to put the dynamic data into name suggester.

--  
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/77987d5d-42c8-49fc-a93c-17bd2d2ca19e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77987d5d-42c8-49fc-a93c-17bd2d2ca19e%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:** ![Rahul\_Kalra](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@Rahul\_Kalra](https://discuss.elastic.co/u/Rahul_Kalra)\
**Post date:** [January 17, 2014, 7:40pm UTC](https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285/3 "2014-01-17T19:40:53Z")

</div>

Any Suggestions please ?

On Thursday, January 16, 2014 5:29:01 PM UTC-8, Rahul Kalra wrote:

> Hi,  
> I am pretty new to Elastic Search, please help me find out how can I use  
> name\_suggest on the data which I capture from ldap river.
> 
> I am trying to put the value of _first name_ and _last name_ fetched from  
> ldap river directly to _name\_suggest_ input so that these can be used in  
> suggestions.
> 
> _Step 1_. Created index with name\_suggestor
> 
> curl -X PUT localhost:9200/ldapdata4 -d '  
> {  
> "mappings": {  
> "persons1" : {  
> "properties" : {  
> "dsId" : { "type" : "string" },  
> "firstName" : { "type" : "string" },  
> "lastName" : { "type" : "string" },  
> "name\_suggest" : {  
> "type" : "completion"  
> }  
> }  
> }  
> }  
> }'
> 
> Checked the mapping created by running :  
> [http://localhost:9200/ldapdata4/\_mapping](http://localhost:9200/ldapdata4/_mapping)
> 
> {  
> "ldapdata4": {  
> "persons1": {  
> "properties": {  
> "dsId": {  
> "type": "string"  
> },  
> "firstName": {  
> "type": "string"  
> },  
> "lastName": {  
> "type": "string"  
> },  
> "name\_suggest": {  
> "type": "completion",  
> "analyzer": "simple",  
> "payloads": false,  
> "preserve\_separators": true,  
> "preserve\_position\_increments": true,  
> "max\_input\_len": 50  
> },  
> }  
> }  
> }  
> }
> 
> \*Step 2: \*Restarted the Elasticsearch instance and it fetched the data  
> from ldap.
> 
> * * *
> 
> curl -XPUT 'localhost:9200/\_river/my\_ldap\_river1/\_meta' -d '{  
> "type" : "ldap",  
> "ldap" : {  
> "host" : "[lookup-uat.mycomp.com](http://lookup-uat.mycomp.com)",  
> "userDn" : "",  
> "credentials" : "",  
> "baseDn" : "ou=people,o=mycomp",  
> "filter" : "(objectClass=person)",  
> "poll" : "86400s",  
> "scope" : "subtree",  
> "attributes" : [  
> "mycompDSID",  
> "mycompDSID",  
> "givenName",  
> "mycompLastName",  
> ],  
> "fields" : [  
> "\_id",  
> "dsId",  
> "firstName",  
> "lastName"  
> ],
> 
> - "name\_suggest" : {\*
> - 
> 
> ```
> "input" : ["firstName",*
> 
> ```
> 
> - 
> 
> ```
> "lastName"*
> 
> ```
> 
> - 
> 
> ```
> ]*
> 
> ```
> 
> - }\*  
> },  
> "index" : {  
> "index" : "ldapdata4",  
> "type" : "persons1"  
> }  
> }'
> 
> * * *
> 
> _Step 3: Checked the data inserted and found name\_suggestor is not  
> populated_  
> [http://localhost:9200/ldapdata4/\_search?pretty=true&q=\*:](http://localhost:9200/ldapdata4/_search?pretty=true&q=*:)\*
> 
> {  
> "took" : 3,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 4,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "ldapdata4",  
> "\_type" : "persons1",  
> "\_id" : "143",  
> "\_score" : 1.0, "\_source" :  
> {"lastName":["babot","babbott"],"firstName":"Aarun"}  
> }, {  
> "\_index" : "ldapdata4",  
> "\_type" : "persons1",  
> "\_id" : "93",  
> "\_score" : 1.0, "\_source" :  
> {"lastName":"sacskerson","firstName":"test"}  
> }
> 
> Please help me, how to put the dynamic data into name suggester.

--  
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/d9f6f2b5-cf99-45ac-b9dd-8debfdef4fff%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d9f6f2b5-cf99-45ac-b9dd-8debfdef4fff%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:56am UTC](https://discuss.elastic.co/t/dynamic-data-into-name-suggester/15285/4 "2017-07-06T01:56:08Z")

</div>

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


