# Completion suggester with jdbc river

**URL:** <https://discuss.elastic.co/t/completion-suggester-with-jdbc-river/18387>\
**Category:** Elasticsearch\
**Created:** [June 29, 2014, 5:43pm UTC](https://discuss.elastic.co/t/completion-suggester-with-jdbc-river/18387 "2014-06-29T17:43:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leningrast\_2](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@leningrast\_2](https://discuss.elastic.co/u/leningrast_2)\
**Post date:** [June 29, 2014, 5:43pm UTC](https://discuss.elastic.co/t/completion-suggester-with-jdbc-river/18387/1 "2014-06-29T17:43:56Z")

</div>

Hi,

I plan to use ES with jprantes JDBC-River  
[https://github.com/jprante/elasticsearch-river-jdbc](https://github.com/jprante/elasticsearch-river-jdbc), a completion  
suggester  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html)  
and a Postgresql Database in my next project.

I tested the combination of ES, the JDBC-River and Postgres, it worked well  
for me. My problem is that i have no clue how i could built an index like  
the example index [http://www.elasticsearch.org/blog/you-complete-me/](http://www.elasticsearch.org/blog/you-complete-me/) on  
the ES completion suggester website (blog):

curl -X PUT localhost:9200/hotels/hotel/1 -d '  
{  
"name" : "Mercure Hotel Munich",  
"city" : "Munich",  
"name\_suggest" : {  
"input" : [  
"Mercure Hotel Munich",  
"Mercure Munich"  
]  
}  
}'

Complete suggesters are build on top of a search graph. Each user input  
reduces the pathes on the graph. But only exact matches will remain. If  
multiple queries should leed to one result, the ES website suggests to  
provide multiple "input" fields like above. I will have thousands of  
documents and can not craft my index manually like it seems on the site.

My question is now: _How can i automatically build an ES index with a  
JDBC-River?_

I hope you can give me some input. Thanks in advance!

--  
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/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 29, 2014, 7:35pm UTC](https://discuss.elastic.co/t/completion-suggester-with-jdbc-river/18387/2 "2014-06-29T19:35:51Z")

</div>

You have two options:

- create all indices/mappings you need before instantiating a JDBC river  
instance. This is the preferred option.

- or you can include a single index settings/mappings JSON into the JDBC  
river instantiation command

Jörg

On Sun, Jun 29, 2014 at 7:43 PM, leningrast [markus.bayer85@gmail.com](mailto:markus.bayer85@gmail.com)  
wrote:

> Hi,
> 
> I plan to use ES with jprantes JDBC-River  
> [https://github.com/jprante/elasticsearch-river-jdbc](https://github.com/jprante/elasticsearch-river-jdbc), a completion  
> suggester  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html)  
> and a Postgresql Database in my next project.
> 
> I tested the combination of ES, the JDBC-River and Postgres, it worked  
> well for me. My problem is that i have no clue how i could built an index  
> like the example index  
> [http://www.elasticsearch.org/blog/you-complete-me/](http://www.elasticsearch.org/blog/you-complete-me/) on the ES completion  
> suggester website (blog):
> 
> curl -X PUT localhost:9200/hotels/hotel/1 -d '  
> {  
> "name" : "Mercure Hotel Munich",  
> "city" : "Munich",  
> "name\_suggest" : {  
> "input" : [  
> "Mercure Hotel Munich",  
> "Mercure Munich"  
> ]  
> }  
> }'
> 
> Complete suggesters are build on top of a search graph. Each user input  
> reduces the pathes on the graph. But only exact matches will remain. If  
> multiple queries should leed to one result, the ES website suggests to  
> provide multiple "input" fields like above. I will have thousands of  
> documents and can not craft my index manually like it seems on the site.
> 
> My question is now: _How can i automatically build an ES index with a  
> JDBC-River?_
> 
> I hope you can give me some input. Thanks in advance!
> 
> --  
> 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/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8d30f5cd-2b28-42d2-9af0-6fc7af872520%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoHNwJ7ZrvJpY%3DArByfRTmaeDVaVMT0O-%3DZEO1S026fhXQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHNwJ7ZrvJpY%3DArByfRTmaeDVaVMT0O-%3DZEO1S026fhXQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:19am UTC](https://discuss.elastic.co/t/completion-suggester-with-jdbc-river/18387/3 "2017-07-06T01:19:08Z")

</div>


