# Query search with "completion" field does not find results

**URL:** <https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547>\
**Category:** Elasticsearch\
**Created:** [November 22, 2013, 3:41pm UTC](https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547 "2013-11-22T15:41:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tihomir\_Lichev1](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Tihomir\_Lichev1](https://discuss.elastic.co/u/Tihomir_Lichev1)\
**Post date:** [November 22, 2013, 3:41pm UTC](https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547/1 "2013-11-22T15:41:41Z")

</div>

Hi  
I have the index and mapping structure, described in the attached file  
I'm using the Java API to make queries:

QueryBuilder termQuery = QueryBuilders.queryString("The Search Phrase")  
.field("keywords", 1.3f)  
.field("title", 2f)  
.field("description", 1.0f)  
.field("full\_text", 1.0f)  
.defaultOperator(Operator.AND);

Which generates the following query JSON:  
{  
"query" : {  
"query\_string" : {  
"query" : "The Search Phrase",  
"fields" : [ "keywords^1.3", "title^2.0", "description^1.0",  
"full\_text^1.0" ],  
"default\_operator" : "and"  
}  
}  
}

Running this results no documents found.

If I remove "_full\_text_" from the fields list ( "fields" : [  
"keywords^1.3", "title^2.0", "description^1.0" ] ) it finds for example 20  
documents

The "_full\_text_" is of type "_completion_" as you can see from the  
attachment, and it contains the search phrase.  
If it is included in the fields list no documents are found.

Am I doing something wrong ?

Best regards  
Tihomir

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 23, 2013, 6:01am UTC](https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547/2 "2013-11-23T06:01:21Z")

</div>

Hey,

completion fields are stored differently and are only intended to be used  
in suggest queries. You could maybe use a multifield, see

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Fri, Nov 22, 2013 at 4:41 PM, Tihomir Lichev [shoteff@gmail.com](mailto:shoteff@gmail.com) wrote:

> Hi  
> I have the index and mapping structure, described in the attached file  
> I'm using the Java API to make queries:
> 
> QueryBuilder termQuery = QueryBuilders.queryString("The Search Phrase")  
> .field("keywords", 1.3f)  
> .field("title", 2f)  
> .field("description", 1.0f)  
> .field("full\_text", 1.0f)  
> .defaultOperator(Operator.AND);
> 
> Which generates the following query JSON:  
> {  
> "query" : {  
> "query\_string" : {  
> "query" : "The Search Phrase",  
> "fields" : [ "keywords^1.3", "title^2.0", "description^1.0",  
> "full\_text^1.0" ],  
> "default\_operator" : "and"  
> }  
> }  
> }
> 
> Running this results no documents found.
> 
> If I remove "_full\_text_" from the fields list ( "fields" : [  
> "keywords^1.3", "title^2.0", "description^1.0" ] ) it finds for example  
> 20 documents
> 
> The "_full\_text_" is of type "_completion_" as you can see from the  
> attachment, and it contains the search phrase.  
> If it is included in the fields list no documents are found.
> 
> Am I doing something wrong ?
> 
> Best regards  
> Tihomir
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tihomir\_Lichev1](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Tihomir\_Lichev1](https://discuss.elastic.co/u/Tihomir_Lichev1)\
**Post date:** [November 23, 2013, 8:25am UTC](https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547/3 "2013-11-23T08:25:42Z")

</div>

I can't understand why the inclusion of such field breaks the result  
На 23.11.2013 08:01 "Alexander Reelsen" [alr@spinscale.de](mailto:alr@spinscale.de) написа:

> Hey,
> 
> completion fields are stored differently and are only intended to be used  
> in suggest queries. You could maybe use a multifield, see  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-multi-field-type.html)
> 
> --Alex
> 
> On Fri, Nov 22, 2013 at 4:41 PM, Tihomir Lichev [shoteff@gmail.com](mailto:shoteff@gmail.com) wrote:
> 
> > Hi  
> > I have the index and mapping structure, described in the attached file  
> > I'm using the Java API to make queries:
> > 
> > QueryBuilder termQuery = QueryBuilders.queryString("The Search Phrase")  
> > .field("keywords", 1.3f)  
> > .field("title", 2f)  
> > .field("description", 1.0f)  
> > .field("full\_text", 1.0f)  
> > .defaultOperator(Operator.AND);
> > 
> > Which generates the following query JSON:  
> > {  
> > "query" : {  
> > "query\_string" : {  
> > "query" : "The Search Phrase",  
> > "fields" : [ "keywords^1.3", "title^2.0", "description^1.0",  
> > "full\_text^1.0" ],  
> > "default\_operator" : "and"  
> > }  
> > }  
> > }
> > 
> > Running this results no documents found.
> > 
> > If I remove "_full\_text_" from the fields list ( "fields" : [  
> > "keywords^1.3", "title^2.0", "description^1.0" ] ) it finds for example  
> > 20 documents
> > 
> > The "_full\_text_" is of type "_completion_" as you can see from the  
> > attachment, and it contains the search phrase.  
> > If it is included in the fields list no documents are found.
> > 
> > Am I doing something wrong ?
> > 
> > Best regards  
> > Tihomir
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/oolo6IathEw/unsubscribe](https://groups.google.com/d/topic/elasticsearch/oolo6IathEw/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
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, 2:05am UTC](https://discuss.elastic.co/t/query-search-with-completion-field-does-not-find-results/14547/4 "2017-07-06T02:05:09Z")

</div>

Closed on July 6, 2017, 2:05am UTC


