# Elastic search Query : Is there any way to control the output of a search query

**URL:** https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739
**Category:** Elasticsearch
**Created:** [February 14, 2013, 9:14am UTC](https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739 "2013-02-14T09:14:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mohit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohit\_Kumar](https://discuss.elastic.co/u/mohit_Kumar)
#### Post date: [February 14, 2013, 9:14am UTC](https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739/1 "2013-02-14T09:14:50Z")

</div>

Hi folks  
Is there any way to control the output of a search query.  
For example  
Put Query:  
{  
"Message Data" = "Hello dear how are you? I am going for shopping. Would  
you like to have something."  
}

Get Query:  
how can i create my get to to retrieve value from message data till "hello  
dear how are you"?

Thanks and regards  
Mohit Kumar Yadav

--  
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: ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)
#### Post date: [February 14, 2013, 9:59am UTC](https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739/2 "2013-02-14T09:59:53Z")

</div>

Hello Mohit,

If what you want is to get partial contents from fields, then I think  
you're stuck with doing it from your application.

If you need to only retrieve certain fields, you can do it by specifying  
which fields you want:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Thu, Feb 14, 2013 at 11:14 AM, Mohit Kumar Yadav \<  
[mohit.kumar.ngi@gmail.com](mailto:mohit.kumar.ngi@gmail.com)\> wrote:

> Hi folks  
> Is there any way to control the output of a search query.  
> For example  
> Put Query:  
> {  
> "Message Data" = "Hello dear how are you? I am going for shopping.  
> Would you like to have something."  
> }
> 
> Get Query:  
> how can i create my get to to retrieve value from message data till "hello  
> dear how are you"?
> 
> Thanks and regards  
> Mohit Kumar Yadav
> 
> --  
> 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: ![sujoysett](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@sujoysett](https://discuss.elastic.co/u/sujoysett)
#### Post date: [February 14, 2013, 2:36pm UTC](https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739/3 "2013-02-14T14:36:22Z")

</div>

Hi,

Not exactly sure whether it will be applicable in your case .... but script  
fields might be useful for you.  
You can try searching for first punctuation and trimming upto that, or  
something similar depending upon your requirement.

> **[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.

-- Sujoy.

On Thursday, February 14, 2013 2:44:50 PM UTC+5:30, Mohit Kumar Yadav wrote:

> Hi folks  
> Is there any way to control the output of a search query.  
> For example  
> Put Query:  
> {  
> "Message Data" = "Hello dear how are you? I am going for shopping.  
> Would you like to have something."  
> }
> 
> Get Query:  
> how can i create my get to to retrieve value from message data till "hello  
> dear how are you"?
> 
> Thanks and regards  
> Mohit Kumar Yadav

--  
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:51am UTC](https://discuss.elastic.co/t/elastic-search-query-is-there-any-way-to-control-the-output-of-a-search-query/10739/4 "2017-07-06T02:51:26Z")

</div>


