# SearchEngine with suggestion

**URL:** <https://discuss.elastic.co/t/searchengine-with-suggestion/5464>\
**Category:** Elasticsearch\
**Created:** [September 27, 2011, 1:22pm UTC](https://discuss.elastic.co/t/searchengine-with-suggestion/5464 "2011-09-27T13:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlo](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@erlo](https://discuss.elastic.co/u/erlo)\
**Post date:** [September 27, 2011, 1:22pm UTC](https://discuss.elastic.co/t/searchengine-with-suggestion/5464/1 "2011-09-27T13:22:01Z")

</div>

Hello,

I'm quite lost in Elasticsearch (and maybe Lucene...).  
For the moment I'm trying to do a simple auto suggestion system for a  
search engine.

My documents contain many "sentences" fields (around 4). What I would  
like is to return result only concerning the word token found.  
For the moment I'm playing with nGram and EdgeNGram, the result I expect  
is good, but I just want the concerning word, not the whole field.

For example:

mydocument:  
field1: "thank you for your answer, it will help me"  
field2: "this is only an example content"

my entry is : "answ", I just want to get "answer"  
...

Is there a way to do this...?

Thanks !

--  
Erwan

---

<div class="post-metadata">

**Author:** ![Lee\_Hambley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_hambley/32/3120_2.png) [@Lee\_Hambley](https://discuss.elastic.co/u/Lee_Hambley)\
**Post date:** [September 27, 2011, 1:42pm UTC](https://discuss.elastic.co/t/searchengine-with-suggestion/5464/2 "2011-09-27T13:42:45Z")

</div>

Erwan,

(also no expert here) but I think it's quite normal that the whole field is  
returned. Have you considered maybe having a "common search terms" index,  
with one-word-per-field, updated from data taken from other indices? That  
would appear to make more sense.

- Lee

On 27 September 2011 15:22, Erwan Loaëc [erwan.loaec@cgin.fr](mailto:erwan.loaec@cgin.fr) wrote:

> Hello,
> 
> I'm quite lost in Elasticsearch (and maybe Lucene...).  
> For the moment I'm trying to do a simple auto suggestion system for a  
> search engine.
> 
> My documents contain many "sentences" fields (around 4). What I would like  
> is to return result only concerning the word token found.  
> For the moment I'm playing with nGram and EdgeNGram, the result I expect is  
> good, but I just want the concerning word, not the whole field.
> 
> For example:
> 
> mydocument:  
> field1: "thank you for your answer, it will help me"  
> field2: "this is only an example content"
> 
> my entry is : "answ", I just want to get "answer"  
> ...
> 
> Is there a way to do this...?
> 
> Thanks !
> 
> --  
> Erwan

---

<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, 3:53am UTC](https://discuss.elastic.co/t/searchengine-with-suggestion/5464/3 "2017-07-06T03:53:29Z")

</div>


