# Query returns the same document 7 times

**URL:** <https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228>\
**Category:** Elasticsearch\
**Created:** [June 2, 2013, 7:45pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228 "2013-06-02T19:45:22Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 4, 2013, 8:11am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/21 "2013-06-04T08:11:41Z")

</div>

## Have a look also at sense: [GitHub - bleskes/sense: A JSON aware developer's interface to Elasticsearch. Comes with handy machinery such as syntax highlighting, autocomplete, formatting and code folding.](https://github.com/bleskes/sense)

David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 4 juin 2013 à 09:07, eranid [eranid@gmail.com](mailto:eranid@gmail.com) a écrit :

> I found that using the plugin elastisearch-head really helped me monitor my  
> indexes.  
> Especially at the testing phase where there is a rather small number of  
> documents.
> 
> It's a very handy debugging tool.  
> [ElasticSearch Head](http://mobz.github.io/elasticsearch-head/)  
> [http://mobz.github.io/elasticsearch-head/](http://mobz.github.io/elasticsearch-head/)
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Query-returns-the-same-document-7-times-tp4035888p4035970.html](http://elasticsearch-users.115913.n3.nabble.com/Query-returns-the-same-document-7-times-tp4035888p4035970.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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:** ![Kya\_W](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@Kya\_W](https://discuss.elastic.co/u/Kya_W)\
**Post date:** [June 4, 2013, 9:15am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/22 "2013-06-04T09:15:59Z")

</div>

Great! Thank you! This really helped me alot 🙂

Den söndagen den 2:e juni 2013 kl. 21:45:22 UTC+2 skrev Kya W:

> Hi there!  
> I'm currently trying to use Elasticsearch in my thesis work, but  
> encountered a problem. If I use a term, for example "Monkey", which has 1  
> hit in my index... It returns this document 7 times. I use Jest together  
> with Elasticsearch since it was a bit easier to understand. I want every  
> document in my index to be returned maximum 1 time per search... not 7. I  
> would be very grateful for your help. I provide the code I have i my  
> "QueryManager" so far:
> 
> public class QueryManager {
> 
> ```
> private SearchSourceBuilder searchBuilder;
> private JestClient client;
> 
> public QueryManager(JestClient client){
> this.client = client;
> searchBuilder = new SearchSourceBuilder();
>     
> }
> 
> public List<Documents> matches(String search){
> Search search1 = new 
> 
> ```
> 
> Search(searchBuilder.query(QueryBuilders.multiMatchQuery(  
> search, //our search-term  
> "title", "content", "url") //searching in the fields title,  
> content and url  
> ).toString());  
> search1.addIndex("data");  
> search1.addType("apa");
> 
> ```
> JestResult result;
> try {
> result = client.execute(search1);
> List<Documents> documents = 
> 
> ```
> 
> result.getSourceAsObjectList(Documents.class);  
> //debug, return size of list  
> System.out.println(documents.size());  
> return documents;  
> } catch (Exception e) {  
> // TODO Auto-generated catch block  
> e.printStackTrace();  
> System.out.println("Nooo \n");  
> return null;  
> }
> 
> ```
> }
> 
> ```
> 
> }

--  
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:33am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/23 "2017-07-06T02:33:08Z")

</div>

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



[Previous page](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228.md?page=1)
