# 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:** 20\
**Page:** 1

<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 2, 2013, 7:45pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/1 "2013-06-02T19:45:22Z")

</div>

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:** ![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 3, 2013, 9:55am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/2 "2013-06-03T09:55:11Z")

</div>

I would really appreciate help in this since I need to complete my thesis  
work!

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:** ![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 3, 2013, 9:58am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/3 "2013-06-03T09:58:10Z")

</div>

Hard to say.  
May be you have indexed more than one doc?

May be you can illustrate your use case with a full curl recreation that you can GIST?

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

Le 3 juin 2013 à 11:55, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :

> I would really appreciate help in this since I need to complete my thesis work!
> 
> 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:** ![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 3, 2013, 10:34am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/4 "2013-06-03T10:34:43Z")

</div>

I only have indexed two documents at the moment. I've also dubblechecked by  
deleting everything and index just the two again. I've used a println to  
see what is inside the index and that one only prints out these two  
document. It's really weird... And I sort of suck at cUrl (haven't really  
had the time to learn it yet). Or is it possible to index the same document  
with the same id, the same field and contents etc more than once?

Den måndagen den 3:e juni 2013 kl. 11:58:10 UTC+2 skrev David Pilato:

> Hard to say.  
> May be you have indexed more than one doc?
> 
> May be you can illustrate your use case with a full curl recreation that  
> you can GIST?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 3 juin 2013 à 11:55, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> I would really appreciate help in this since I need to complete my thesis  
> work!
> 
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> 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:** ![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 3, 2013, 3:05pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/5 "2013-06-03T15:05:46Z")

</div>

Does nobody have a clue?

Den måndagen den 3:e juni 2013 kl. 12:34:43 UTC+2 skrev Kya W:

> I only have indexed two documents at the moment. I've also dubblechecked  
> by deleting everything and index just the two again. I've used a println to  
> see what is inside the index and that one only prints out these two  
> document. It's really weird... And I sort of suck at cUrl (haven't really  
> had the time to learn it yet). Or is it possible to index the same document  
> with the same id, the same field and contents etc more than once?
> 
> Den måndagen den 3:e juni 2013 kl. 11:58:10 UTC+2 skrev David Pilato:
> 
> > Hard to say.  
> > May be you have indexed more than one doc?
> > 
> > May be you can illustrate your use case with a full curl recreation that  
> > you can GIST?
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 3 juin 2013 à 11:55, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> > 
> > I would really appreciate help in this since I need to complete my thesis  
> > work!
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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:** ![Roy\_Russo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_russo/32/44835_2.png) [@Roy\_Russo](https://discuss.elastic.co/u/Roy_Russo)\
**Post date:** [June 3, 2013, 3:39pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/6 "2013-06-03T15:39:39Z")

</div>

If you aren't comfortable with cURL, then just do a GET request from your  
browser:

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

You can also use a chrome extension, like Advanced REST client for testing:

> **[Advanced REST client](https://chromewebstore.google.com/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)**
>
> The web developers helper program to create and test custom HTTP requests.

On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:

> 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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 3, 2013, 4:22pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/7 "2013-06-03T16:22:42Z")

</div>

You definitely have more than one document indexed. Can you gist (  
[https://gist.github.com/](https://gist.github.com/)) the stats of your cluster using the cluster API?

[http://localhost:9200/\_cluster/nodes/stats](http://localhost:9200/_cluster/nodes/stats) (change from localhost if you  
need to).

curl is easy and a good skill to learn if you will be using elasticsearch.  
I would definitely take the time to learn curl. There used to be a good  
elasticsearch tutorial on their site using various curl commands, but it is  
now gone.

--  
Ivan

On Mon, Jun 3, 2013 at 8:39 AM, Roy Russo [royrusso@gmail.com](mailto:royrusso@gmail.com) wrote:

> If you aren't comfortable with cURL, then just do a GET request from your  
> browser:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> 
> You can also use a chrome extension, like Advanced REST client for testing:
> 
> [https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> 
> On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> 
> > 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).

--  
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 3, 2013, 4:26pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/8 "2013-06-03T16:26:24Z")

</div>

Yes, I have tested and used cUrl a bit. But it's the same result as in my  
java-application. I only see two documents in my index. Is it possible that  
Elasticsearch might index identical documents multiple times? Have no idea  
how I could see that in my index since it only returns one post per  
index/type/id. I'm really stuck. I provided my java-code for the query in  
the first post.

Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:

> If you aren't comfortable with cURL, then just do a GET request from your  
> browser:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> 
> You can also use a chrome extension, like Advanced REST client for testing:
> 
> [https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> 
> On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> 
> > 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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 3, 2013, 4:30pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/9 "2013-06-03T16:30:33Z")

</div>

How exactly are you determining that there are only two documents in your  
index? The issue is very likely not in your querying code, but in your  
indexing. Then again, I have never used Jest so I haven't explored that  
code.

On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) wrote:

> Yes, I have tested and used cUrl a bit. But it's the same result as in my  
> java-application. I only see two documents in my index. Is it possible that  
> Elasticsearch might index identical documents multiple times? Have no idea  
> how I could see that in my index since it only returns one post per  
> index/type/id. I'm really stuck. I provided my java-code for the query in  
> the first post.
> 
> Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:
> 
> > If you aren't comfortable with cURL, then just do a GET request from your  
> > browser:
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **guide/reference/api/search/** uri-request/)[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > 
> > You can also use a chrome extension, like Advanced REST client for  
> > testing:
> > 
> > [https://chrome.google.com/\*\*webstore/detail/advanced-rest-\*\*client/](https://chrome.google.com/ **webstore/detail/advanced-rest-** client/)\*\*  
> > hgmloofddffdnphfgcellkdfbfbjel\*\*oo?hl=en-US[https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > 
> > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> > 
> > > 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).

--  
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 3, 2013, 6:12pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/10 "2013-06-03T18:12:17Z")

</div>

I'm using "GET" to see what I have in the index. I've used it both in the  
java-code by the Elasticsearch API and via cURL. I've used the name of the  
index, type and id since I haven't seen any "show all documents"-get  
anywhere. And I've typed these names for what I've been indexing, which are  
only two documents. So I've indexed two documents, I've also deleted the  
whole thing to be sure and then indexed them again. In my GET I can only  
see these two documents and yet the search-query returns the same documents  
multiple times. I mean that it returns the SAME index, type, id, title,  
content and url several times. Unknown reason.

Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:

> How exactly are you determining that there are only two documents in your  
> index? The issue is very likely not in your querying code, but in your  
> indexing. Then again, I have never used Jest so I haven't explored that  
> code.
> 
> On Mon, Jun 3, 2013 at 9:26 AM, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\>wrote:
> 
> > Yes, I have tested and used cUrl a bit. But it's the same result as in my  
> > java-application. I only see two documents in my index. Is it possible that  
> > Elasticsearch might index identical documents multiple times? Have no idea  
> > how I could see that in my index since it only returns one post per  
> > index/type/id. I'm really stuck. I provided my java-code for the query in  
> > the first post.
> > 
> > Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:
> > 
> > > If you aren't comfortable with cURL, then just do a GET request from  
> > > your browser:
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **guide/reference/api/search/** uri-request/)[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > > 
> > > You can also use a chrome extension, like Advanced REST client for  
> > > testing:
> > > 
> > > [https://chrome.google.com/\*\*webstore/detail/advanced-rest-\*\*client/](https://chrome.google.com/ **webstore/detail/advanced-rest-** client/)\*\*  
> > > hgmloofddffdnphfgcellkdfbfbjel\*\*oo?hl=en-US[https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > > 
> > > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> > > 
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > 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:** ![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 3, 2013, 6:44pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/11 "2013-06-03T18:44:33Z")

</div>

I would really love to help you but it's not possible until you give more information about what you are doing:

How do you index and what?  
How do you search and for what? (I don't speak about GET here).

Please tell us more. You can GIST a full java example if you want. May be we will be able to understand JEST code.  
That said, I'm pretty sure that JEST allows logging REST API calls. It will be even easier if you provide that traces.

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

Le 3 juin 2013 à 20:12, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :

> I'm using "GET" to see what I have in the index. I've used it both in the java-code by the Elasticsearch API and via cURL. I've used the name of the index, type and id since I haven't seen any "show all documents"-get anywhere. And I've typed these names for what I've been indexing, which are only two documents. So I've indexed two documents, I've also deleted the whole thing to be sure and then indexed them again. In my GET I can only see these two documents and yet the search-query returns the same documents multiple times. I mean that it returns the SAME index, type, id, title, content and url several times. Unknown reason.
> 
> Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:  
> How exactly are you determining that there are only two documents in your index? The issue is very likely not in your querying code, but in your indexing. Then again, I have never used Jest so I haven't explored that code.
> 
> On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) wrote:  
> Yes, I have tested and used cUrl a bit. But it's the same result as in my java-application. I only see two documents in my index. Is it possible that Elasticsearch might index identical documents multiple times? Have no idea how I could see that in my index since it only returns one post per index/type/id. I'm really stuck. I provided my java-code for the query in the first post.
> 
> Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:  
> If you aren't comfortable with cURL, then just do a GET request from your browser:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> 
> You can also use a chrome extension, like Advanced REST client for testing:
> 
> [https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> 
> On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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:** ![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 3, 2013, 7:03pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/12 "2013-06-03T19:03:06Z")

</div>

I actually don't think I'm allowed to do that. I'm doing this thesis work  
at Volvo and they don't want people to see everything.... I'll try to  
figure some way to show you exactly what happens. But is it possible that  
Elasticsearch create multiple posts in an index with literally exactly the  
same content (as in fieldnames, indexname, id, type etc)?

I create an index by using Jests API, the commando looks like this:

client.execute(new CreateIndex("articles"));

I honestly don't think the problem is in the creation of the indices and  
atm I have only created a single index called "data". Haven't changed the  
name or anything when I've indexed documents etc

Den måndagen den 3:e juni 2013 kl. 20:44:33 UTC+2 skrev David Pilato:

> I would really love to help you but it's not possible until you give more  
> information about what you are doing:
> 
> How do you index and what?  
> How do you search and for what? (I don't speak about GET here).
> 
> Please tell us more. You can GIST a full java example if you want. May be  
> we will be able to understand JEST code.  
> That said, I'm pretty sure that JEST allows logging REST API calls. It  
> will be even easier if you provide that traces.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 3 juin 2013 à 20:12, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> I'm using "GET" to see what I have in the index. I've used it both in the  
> java-code by the Elasticsearch API and via cURL. I've used the name of the  
> index, type and id since I haven't seen any "show all documents"-get  
> anywhere. And I've typed these names for what I've been indexing, which are  
> only two documents. So I've indexed two documents, I've also deleted the  
> whole thing to be sure and then indexed them again. In my GET I can only  
> see these two documents and yet the search-query returns the same documents  
> multiple times. I mean that it returns the SAME index, type, id, title,  
> content and url several times. Unknown reason.
> 
> Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:
> 
> > How exactly are you determining that there are only two documents in your  
> > index? The issue is very likely not in your querying code, but in your  
> > indexing. Then again, I have never used Jest so I haven't explored that  
> > code.
> > 
> > On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) wrote:
> > 
> > > Yes, I have tested and used cUrl a bit. But it's the same result as in  
> > > my java-application. I only see two documents in my index. Is it possible  
> > > that Elasticsearch might index identical documents multiple times? Have no  
> > > idea how I could see that in my index since it only returns one post per  
> > > index/type/id. I'm really stuck. I provided my java-code for the query in  
> > > the first post.
> > > 
> > > Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:
> > > 
> > > > If you aren't comfortable with cURL, then just do a GET request from  
> > > > your browser:
> > > > 
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/api/search/)\*\*  
> > > > uri-request/[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > > > 
> > > > You can also use a chrome extension, like Advanced REST client for  
> > > > testing:
> > > > 
> > > > [https://chrome.google.com/\*\*webstore/detail/advanced-rest-\*\*client/](https://chrome.google.com/ **webstore/detail/advanced-rest-** client/)\*\*  
> > > > hgmloofddffdnphfgcellkdfbfbjel\*\*oo?hl=en-US[https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > > > 
> > > > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> > > > 
> > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> 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:** ![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 3, 2013, 7:04pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/13 "2013-06-03T19:04:41Z")

</div>

## I don't need to see the payload of each doc. Only how you create each doc (you can remove the doc itself).

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

Le 3 juin 2013 à 21:03, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :

> I actually don't think I'm allowed to do that. I'm doing this thesis work at Volvo and they don't want people to see everything.... I'll try to figure some way to show you exactly what happens. But is it possible that Elasticsearch create multiple posts in an index with literally exactly the same content (as in fieldnames, indexname, id, type etc)?
> 
> I create an index by using Jests API, the commando looks like this:
> 
> client.execute(new CreateIndex("articles"));
> 
> I honestly don't think the problem is in the creation of the indices and atm I have only created a single index called "data". Haven't changed the name or anything when I've indexed documents etc
> 
> Den måndagen den 3:e juni 2013 kl. 20:44:33 UTC+2 skrev David Pilato:  
> I would really love to help you but it's not possible until you give more information about what you are doing:
> 
> How do you index and what?  
> How do you search and for what? (I don't speak about GET here).
> 
> Please tell us more. You can GIST a full java example if you want. May be we will be able to understand JEST code.  
> That said, I'm pretty sure that JEST allows logging REST API calls. It will be even easier if you provide that traces.
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr | @scrutmydocs
> 
> Le 3 juin 2013 à 20:12, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> 
> > I'm using "GET" to see what I have in the index. I've used it both in the java-code by the Elasticsearch API and via cURL. I've used the name of the index, type and id since I haven't seen any "show all documents"-get anywhere. And I've typed these names for what I've been indexing, which are only two documents. So I've indexed two documents, I've also deleted the whole thing to be sure and then indexed them again. In my GET I can only see these two documents and yet the search-query returns the same documents multiple times. I mean that it returns the SAME index, type, id, title, content and url several times. Unknown reason.
> > 
> > Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:  
> > How exactly are you determining that there are only two documents in your index? The issue is very likely not in your querying code, but in your indexing. Then again, I have never used Jest so I haven't explored that code.
> > 
> > On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) wrote:  
> > Yes, I have tested and used cUrl a bit. But it's the same result as in my java-application. I only see two documents in my index. Is it possible that Elasticsearch might index identical documents multiple times? Have no idea how I could see that in my index since it only returns one post per index/type/id. I'm really stuck. I provided my java-code for the query in the first post.
> > 
> > Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:  
> > If you aren't comfortable with cURL, then just do a GET request from your browser:
> > 
> > [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > 
> > You can also use a chrome extension, like Advanced REST client for testing:
> > 
> > [https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > 
> > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 3, 2013, 7:16pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/14 "2013-06-03T19:16:11Z")

</div>

I think most of us are in agreement that you issue might be during indexing.

The indices status API does not return any identifying information. You can  
provide the results or scan it and report the important stats.

Going to [http://localhost:9200/\_status](http://localhost:9200/_status) , find the number of documents like  
so:

{  
"ok": true,  
"\_shards": {  
"total": 10,  
"successful": 10,  
"failed": 0  
},  
"indices": {  
"foo": {  
...

- 

```
 "docs": {*

```

- 

```
   "num_docs": 2,*

```

- 

```
   "max_doc": 2,*

```

- 

```
   "deleted_docs": 0*

```

- 

```
 },*

```

How many docs (across all indices) do you have? Do you have only one index?  
If your browser does not have a JSON viewer, you can probably download an  
extension or paste the results into [http://jsonviewer.stack.hu/](http://jsonviewer.stack.hu/)

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

--  
Ivan

On Mon, Jun 3, 2013 at 12:04 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> I don't need to see the payload of each doc. Only how you create each doc  
> (you can remove the doc itself).
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 3 juin 2013 à 21:03, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :
> 
> I actually don't think I'm allowed to do that. I'm doing this thesis work  
> at Volvo and they don't want people to see everything.... I'll try to  
> figure some way to show you exactly what happens. But is it possible that  
> Elasticsearch create multiple posts in an index with literally exactly the  
> same content (as in fieldnames, indexname, id, type etc)?
> 
> I create an index by using Jests API, the commando looks like this:
> 
> client.execute(new CreateIndex("articles"));
> 
> I honestly don't think the problem is in the creation of the indices and  
> atm I have only created a single index called "data". Haven't changed the  
> name or anything when I've indexed documents etc
> 
> Den måndagen den 3:e juni 2013 kl. 20:44:33 UTC+2 skrev David Pilato:
> 
> > I would really love to help you but it's not possible until you give more  
> > information about what you are doing:
> > 
> > How do you index and what?  
> > How do you search and for what? (I don't speak about GET here).
> > 
> > Please tell us more. You can GIST a full java example if you want. May be  
> > we will be able to understand JEST code.  
> > That said, I'm pretty sure that JEST allows logging REST API calls. It  
> > will be even easier if you provide that traces.
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)[http://elasticsearch.com/](http://elasticsearch.com/)  
> > \*  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > |_\* @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 3 juin 2013 à 20:12, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> > 
> > I'm using "GET" to see what I have in the index. I've used it both in the  
> > java-code by the Elasticsearch API and via cURL. I've used the name of the  
> > index, type and id since I haven't seen any "show all documents"-get  
> > anywhere. And I've typed these names for what I've been indexing, which are  
> > only two documents. So I've indexed two documents, I've also deleted the  
> > whole thing to be sure and then indexed them again. In my GET I can only  
> > see these two documents and yet the search-query returns the same documents  
> > multiple times. I mean that it returns the SAME index, type, id, title,  
> > content and url several times. Unknown reason.
> > 
> > Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:
> > 
> > > How exactly are you determining that there are only two documents in  
> > > your index? The issue is very likely not in your querying code, but in your  
> > > indexing. Then again, I have never used Jest so I haven't explored that  
> > > code.
> > > 
> > > On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) wrote:
> > > 
> > > > Yes, I have tested and used cUrl a bit. But it's the same result as in  
> > > > my java-application. I only see two documents in my index. Is it possible  
> > > > that Elasticsearch might index identical documents multiple times? Have no  
> > > > idea how I could see that in my index since it only returns one post per  
> > > > index/type/id. I'm really stuck. I provided my java-code for the query in  
> > > > the first post.
> > > > 
> > > > Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:
> > > > 
> > > > > If you aren't comfortable with cURL, then just do a GET request from  
> > > > > your browser:
> > > > > 
> > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **g** uide/reference/api/search/**uri-)\*\*  
> > > > > request/[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > > > > 
> > > > > You can also use a chrome extension, like Advanced REST client for  
> > > > > testing:
> > > > > 
> > > > > [https://chrome.google.com/\*\*webs\*\*tore/detail/advanced-rest-\*\*clie](https://chrome.google.com/ **webs** tore/detail/advanced-rest-**clie)\*\*  
> > > > > nt/ **hgmloofddffdnphfgcellkdfbfb** jel\*\*oo?hl=en-US[https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > > > > 
> > > > > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> > > > > 
> > > > > > 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( **Que**
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > ryBuilders.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(
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > **D** ocuments.class);  
> > > > > > //debug, return size of list  
> > > > > > System.out.println(documents. **s** ize());  
> > > > > > 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 elasticsearc...@googlegroups.\*\*com.  
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).  
> > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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).

--  
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 3, 2013, 7:25pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/15 "2013-06-03T19:25:49Z")

</div>

Yes I have only 1 index and yes, it shows more documents than I've (as far  
as I'm aware of) created. Thanks for showing me this! I provide the code  
which I use to create Index, index documents etc and the plain "Documents"  
class. Note that I've only been working on a demo containting lots of other  
elements too so I've began with only 1 index and 2 documents just to not  
mess up everything completely.

import java.net.URL;  
import java.util.LinkedHashSet;

import io.searchbox.client.JestClient;  
import io.searchbox.client.JestClientFactory;  
import io.searchbox.client.config.ClientConfig;  
import io.searchbox.client.config.ClientConstants;  
import io.searchbox.core.Delete;  
import io.searchbox.core.Index;  
import io.searchbox.indices.CreateIndex;

/\*\*

- This class will index documents into searchable JSON-objects.  
\*/  
public class Indexing {  
private ClientConfig clientConfig;  
private LinkedHashSet servers;  
private JestClientFactory factory;  
JestClient client;  
private String indexName = null, indexType = null;

factory  
factory = new JestClientFactory();  
factory.setClientConfig(clientConfig);  
client = factory.getObject();  
//debug  
System.out.println(client.toString());  
}

```
public JestClient getClient(){
    return client;
}
/**
 * Creating an index
 */

private void createIndex(String name){
    try {
        client.execute(new CreateIndex(name));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    
    
}

private void deleteIndex(String index, String type, String id) throws 

```

Exception{  
client.execute(new  
Delete.Builder(id).index(index).type(type).build());  
}

```
private void indexDocuments() throws Exception{
    
    String u = null;
    
    String title1 = "Monkey Business";
    String title2 = "Cake is a Lie";
    
    String content1 = "Monkey is a rare business about bananas. You 

```

don't want to feel the wrath of the monkeys.";  
String content2 = "Everybody wants cake. If you see cake you want  
to eat it. But what if it's a lie?";

```
    u = "http://animal.discovery.com/mammals/monkey-info.htm";
    URL url1 = new URL(u);
    
    u = "http://www.thecakeisalie.com/";
    URL url2 = new URL(u);

    
    
    Documents source1 = new Documents(title1, content1, url1);
    Documents source2 = new Documents(title2, content2, url2);
    Index index = new 

```

Index.Builder(source1).index(indexName).type(indexType).id("0").build();  
Index index1 = new  
Index.Builder(source2).index(indexName).type(indexType).id("1").build();  
client.execute(index);  
client.execute(index1);

```
    DocumentManager dm = new DocumentManager(client);
    System.out.println(dm.getDocuments("0", indexName, indexType));
    System.out.println(dm.getDocuments("1", indexName, indexType));
    System.out.println(dm.getDocuments("2", indexName, indexType));
    
    
}

```

}

import java.net.URL;

public class Documents {

```
private String title;
private String content;
private URL url;

public Documents(String title, String content, URL url){
    this.title = title;
    this.content = content;
    this.url = url;
    
}

public String getTitle(){
    return title;
}

public String getContent(){
    return content;
}

public URL getURL(){
    return url;
}

```

}

The class which connects to Elasticsearch:

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;  
import org.elasticsearch.node.Node;  
import org.elasticsearch.node.NodeBuilder;

/\*\*

- Class to connect the node to the cluster with possibility to start and  
close it along
- with other functions.  
\*/

public class NodeConnection {  
private Node node;  
private Client client, tpclient;

```
public NodeConnection(){
    startNode();
    System.out.println("You have now successfully created a 

```

NodeConnection \n");  
//startTransportClient();  
// System.out.println("You have now successfully created a  
TransportClient \n");  
}  
/\*\*  
\* Initialize the node and connect it to a cluster.  
\*/

```
private void startNode(){
    //Starting the node and setting a cluster name which we can refer to
    node = NodeBuilder.nodeBuilder().local(true).clusterName("Emmas 

```

Cluster").node();

```
    //some debugging
    String string = node.toString();
    System.out.print(string + "\n");
    
    client = node.client();
}

public Client getClient(){
    return client;
}

/**
 *Transportclient which doesn't connect to the cluster, 
 *adding these temporarily since it might be needed for future 

```

functionalities  
\*/

```
private void startTransportClient(){
    //change the default name to the chosen one "Emmas cluster" to make 

```

the tpclient work correctly  
Settings settings = ImmutableSettings.settingsBuilder()  
.put("cluster.name", "Emmas Cluster").build();  
tpclient = new TransportClient(settings).addTransportAddress(new  
InetSocketTransportAddress("host1", 9300))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9300));

```
    //debugging
    String string = tpclient.toString();
    System.out.println(string + "\n");
}

public void closeNode(){
    
    try{
        //tpclient.close();
        node.close();
    }catch (Exception e){
        e.printStackTrace();
        
    }
    System.out.println("The node is now closed with connected clients");
}

```

}

Den måndagen den 3:e juni 2013 kl. 21:16:11 UTC+2 skrev Ivan Brusic:

> I think most of us are in agreement that you issue might be during  
> indexing.
> 
> The indices status API does not return any identifying information. You  
> can provide the results or scan it and report the important stats.
> 
> Going to [http://localhost:9200/\_status](http://localhost:9200/_status) , find the number of documents  
> like so:
> 
> {  
> "ok": true,  
> "\_shards": {  
> "total": 10,  
> "successful": 10,  
> "failed": 0  
> },  
> "indices": {  
> "foo": {  
> ...
> 
> - 
> 
> ```
> "docs": {*
> 
> ```
> 
> - 
> 
> ```
> "num_docs": 2,*
> 
> ```
> 
> - 
> 
> ```
> "max_doc": 2,*
> 
> ```
> 
> - 
> 
> ```
> "deleted_docs": 0*
> 
> ```
> 
> - 
> 
> ```
> },*
> 
> ```
> 
> How many docs (across all indices) do you have? Do you have only one  
> index? If your browser does not have a JSON viewer, you can probably  
> download an extension or paste the results into  
> [http://jsonviewer.stack.hu/](http://jsonviewer.stack.hu/)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-status/)
> 
> --  
> Ivan
> 
> On Mon, Jun 3, 2013 at 12:04 PM, David Pilato \<[da...@pilato.fr](mailto:da...@pilato.fr)\<javascript:\>
> 
> > wrote:
> 
> > I don't need to see the payload of each doc. Only how you create each doc  
> > (you can remove the doc itself).
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 3 juin 2013 à 21:03, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\> a  
> > écrit :
> > 
> > I actually don't think I'm allowed to do that. I'm doing this thesis work  
> > at Volvo and they don't want people to see everything.... I'll try to  
> > figure some way to show you exactly what happens. But is it possible that  
> > Elasticsearch create multiple posts in an index with literally exactly the  
> > same content (as in fieldnames, indexname, id, type etc)?
> > 
> > I create an index by using Jests API, the commando looks like this:
> > 
> > client.execute(new CreateIndex("articles"));
> > 
> > I honestly don't think the problem is in the creation of the indices and  
> > atm I have only created a single index called "data". Haven't changed the  
> > name or anything when I've indexed documents etc
> > 
> > Den måndagen den 3:e juni 2013 kl. 20:44:33 UTC+2 skrev David Pilato:
> > 
> > > I would really love to help you but it's not possible until you give  
> > > more information about what you are doing:
> > > 
> > > How do you index and what?  
> > > How do you search and for what? (I don't speak about GET here).
> > > 
> > > Please tell us more. You can GIST a full java example if you want. May  
> > > be we will be able to understand JEST code.  
> > > That said, I'm pretty sure that JEST allows logging REST API calls. It  
> > > will be even easier if you provide that traces.
> > > 
> > > --  
> > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)[http://elasticsearch.com/](http://elasticsearch.com/)  
> > > \*  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > > |_\* @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > > 
> > > Le 3 juin 2013 à 20:12, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> > > 
> > > I'm using "GET" to see what I have in the index. I've used it both in  
> > > the java-code by the Elasticsearch API and via cURL. I've used the name of  
> > > the index, type and id since I haven't seen any "show all documents"-get  
> > > anywhere. And I've typed these names for what I've been indexing, which are  
> > > only two documents. So I've indexed two documents, I've also deleted the  
> > > whole thing to be sure and then indexed them again. In my GET I can only  
> > > see these two documents and yet the search-query returns the same documents  
> > > multiple times. I mean that it returns the SAME index, type, id, title,  
> > > content and url several times. Unknown reason.
> > > 
> > > Den måndagen den 3:e juni 2013 kl. 18:30:33 UTC+2 skrev Ivan Brusic:
> > > 
> > > > How exactly are you determining that there are only two documents in  
> > > > your index? The issue is very likely not in your querying code, but in your  
> > > > indexing. Then again, I have never used Jest so I haven't explored that  
> > > > code.
> > > > 
> > > > On Mon, Jun 3, 2013 at 9:26 AM, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) wrote:
> > > > 
> > > > > Yes, I have tested and used cUrl a bit. But it's the same result as in  
> > > > > my java-application. I only see two documents in my index. Is it possible  
> > > > > that Elasticsearch might index identical documents multiple times? Have no  
> > > > > idea how I could see that in my index since it only returns one post per  
> > > > > index/type/id. I'm really stuck. I provided my java-code for the query in  
> > > > > the first post.
> > > > > 
> > > > > Den måndagen den 3:e juni 2013 kl. 17:39:39 UTC+2 skrev Roy Russo:
> > > > > 
> > > > > > If you aren't comfortable with cURL, then just do a GET request from  
> > > > > > your browser:
> > > > > > 
> > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **g** uide/reference/api/search/**uri-)\*\*  
> > > > > > request/[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > > > > > 
> > > > > > You can also use a chrome extension, like Advanced REST client for  
> > > > > > testing:
> > > > > > 
> > > > > > [https://chrome.google.com/\*\*webs\*\*tore/detail/advanced-rest-\*\*clie](https://chrome.google.com/ **webs** tore/detail/advanced-rest-**clie)\*\*  
> > > > > > nt/ **hgmloofddffdnphfgcellkdfbfb** jel\*\*oo?hl=en-US[https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US)
> > > > > > 
> > > > > > On Sunday, June 2, 2013 3:45:22 PM UTC-4, Kya W wrote:
> > > > > > 
> > > > > > > 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( **Que**
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > ryBuilders.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(
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > **D** ocuments.class);  
> > > > > > > //debug, return size of list  
> > > > > > > System.out.println(documents. **s** ize());  
> > > > > > > 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 elasticsearc...@googlegroups.\*\*com.  
> > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).  
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > 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:** ![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 3, 2013, 7:36pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/16 "2013-06-03T19:36:17Z")

</div>

How do you search?

BTW, please avoid spaces and uppercase characters in cluster name. It could works, but I would really avoid to use _special chars_.

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

Le 3 juin 2013 à 21:25, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :

> ```
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("cluster.name", "Emmas Cluster").build();
> 
> ```

---

<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 3, 2013, 7:44pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/17 "2013-06-03T19:44:13Z")

</div>

provided the "querymanager" in my first post, but can post it again. And  
thanks for the tip about name, will change that immediately. I've tried a  
few different kinds of queries, therefore you can see one that is currently  
annotated (sorry for bad English) and not in use atm. I put the search-term  
intyped through a html-page into a servlet which puts this search-term into  
my Queryhandler. That code I cannot provide though since it includes some  
hush-hush stuff.

import java.util.List;

import io.searchbox.client.JestClient;  
import io.searchbox.client.JestResult;  
import io.searchbox.core.Search;

import org.elasticsearch.index.query.QueryBuilders;  
import org.elasticsearch.search.builder.SearchSourceBuilder;

/\*\*

- This is were we will build our queries for elasticsearch  
\*/

public class QueryManager {

```
private SearchSourceBuilder searchBuilder;
private JestClient client;

public QueryManager(JestClient client){
    this.client = client;
    searchBuilder = new SearchSourceBuilder();
    
}

public List<Documents> matches(String term){
    
    Search search = (Search) new 

```

Search(searchBuilder.query(QueryBuilders.matchQuery("title",  
term)).toString());

```
   // Search search = new 

```

Search(searchBuilder.query(QueryBuilders.multiMatchQuery(  
//term, //our search-term  
//"title", "content", "url") //searching in the fields title,  
content and url  
//).toString());

```
   search.addIndex("data");
   search.addType("apa");            

    JestResult result;
    try {
        result = client.execute(search);
        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;  
}

```
}

```

Den måndagen den 3:e juni 2013 kl. 21:36:17 UTC+2 skrev David Pilato:

> How do you search?
> 
> BTW, please avoid spaces and uppercase characters in cluster name. It  
> could works, but I would really avoid to use _special chars_.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 3 juin 2013 à 21:25, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> ```
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("cluster.name", "Emmas Cluster").build();
> 
> ```

--  
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:** ![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 3, 2013, 7:51pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/18 "2013-06-03T19:51:08Z")

</div>

Sounds good to me.

So you probably have remaining documents in your index.  
And as you remove on documents with ID 1, 2 and 3, if there are some other docs, they won't be removed.

New suggestion:  
Stop your ES node.  
Remove "/data/Emmas Cluster" dir  
Restart ES  
Restart your test

It will remove everything in your cluster.

Best, you can do it using a CURL request (or any google chrome tool, such the one Ivan indicated): curl -XDELETE localhost:9200

If you have any other running node using the same cluster name, everything will be deleted as well.

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

Le 3 juin 2013 à 21:44, Kya W [kyawolfwritten@gmail.com](mailto:kyawolfwritten@gmail.com) a écrit :

> provided the "querymanager" in my first post, but can post it again. And thanks for the tip about name, will change that immediately. I've tried a few different kinds of queries, therefore you can see one that is currently annotated (sorry for bad English) and not in use atm. I put the search-term intyped through a html-page into a servlet which puts this search-term into my Queryhandler. That code I cannot provide though since it includes some hush-hush stuff.
> 
> import java.util.List;
> 
> import io.searchbox.client.JestClient;  
> import io.searchbox.client.JestResult;  
> import io.searchbox.core.Search;
> 
> import org.elasticsearch.index.query.QueryBuilders;  
> import org.elasticsearch.search.builder.SearchSourceBuilder;
> 
> /\*\*
> 
> - This is were we will build our queries for elasticsearch  
> \*/
> 
> public class QueryManager {
> 
> ```
> private SearchSourceBuilder searchBuilder;
> private JestClient client;
> 
> public QueryManager(JestClient client){
> this.client = client;
> searchBuilder = new SearchSourceBuilder();
>     
> }
> 
> public List<Documents> matches(String term){
>     
> Search search = (Search) new Search(searchBuilder.query(QueryBuilders.matchQuery("title", term)).toString());
>     
> // Search search = new Search(searchBuilder.query(QueryBuilders.multiMatchQuery(
> //term, //our search-term
> //"title", "content", "url") //searching in the fields title, content and url
> //).toString());
> 
> search.addIndex("data");
> search.addType("apa");            
> 
> JestResult result;
> try {
> result = client.execute(search);
> 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;
> }
>     
>     
>    
> }
> 
> ```
> 
> Den måndagen den 3:e juni 2013 kl. 21:36:17 UTC+2 skrev David Pilato:  
> How do you search?
> 
> BTW, please avoid spaces and uppercase characters in cluster name. It could works, but I would really avoid to use _special chars_.
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr | @scrutmydocs
> 
> Le 3 juin 2013 à 21:25, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> 
> > ```
> > Settings settings = ImmutableSettings.settingsBuilder()
> > .put("cluster.name", "Emmas Cluster").build();
> > 
> > ```
> 
> --  
> 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 3, 2013, 8:37pm UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/19 "2013-06-03T20:37:08Z")

</div>

It works now 🙂 Thank you so much!

I love and hate studying to become a Software Engineer. There are so many  
moments you feel like an idiot, but you also learn a lot on the way!

Thanks again!

Den måndagen den 3:e juni 2013 kl. 21:51:08 UTC+2 skrev David Pilato:

> Sounds good to me.
> 
> So you probably have remaining documents in your index.  
> And as you remove on documents with ID 1, 2 and 3, if there are some other  
> docs, they won't be removed.
> 
> New suggestion:  
> Stop your ES node.  
> Remove "/data/Emmas Cluster" dir  
> Restart ES  
> Restart your test
> 
> It will remove everything in your cluster.
> 
> Best, you can do it using a CURL request (or any google chrome tool, such  
> the one Ivan indicated): curl -XDELETE localhost:9200
> 
> If you have any other running node using the same cluster name, everything  
> will be deleted as well.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 3 juin 2013 à 21:44, Kya W \<[kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> provided the "querymanager" in my first post, but can post it again. And  
> thanks for the tip about name, will change that immediately. I've tried a  
> few different kinds of queries, therefore you can see one that is currently  
> annotated (sorry for bad English) and not in use atm. I put the search-term  
> intyped through a html-page into a servlet which puts this search-term into  
> my Queryhandler. That code I cannot provide though since it includes some  
> hush-hush stuff.
> 
> import java.util.List;
> 
> import io.searchbox.client.JestClient;  
> import io.searchbox.client.JestResult;  
> import io.searchbox.core.Search;
> 
> import org.elasticsearch.index.query.QueryBuilders;  
> import org.elasticsearch.search.builder.SearchSourceBuilder;
> 
> /\*\*
> 
> - This is were we will build our queries for elasticsearch  
> \*/
> 
> public class QueryManager {
> 
> ```
> private SearchSourceBuilder searchBuilder;
> private JestClient client;
> 
> public QueryManager(JestClient client){
> this.client = client;
> searchBuilder = new SearchSourceBuilder();
>     
> }
> 
> public List<Documents> matches(String term){
>     
> Search search = (Search) new 
> 
> ```
> 
> Search(searchBuilder.query(QueryBuilders.matchQuery("title",  
> term)).toString());
> 
> ```
> // Search search = new 
> 
> ```
> 
> Search(searchBuilder.query(QueryBuilders.multiMatchQuery(  
> //term, //our search-term  
> //"title", "content", "url") //searching in the fields title,  
> content and url  
> //).toString());
> 
> ```
> search.addIndex("data");
> search.addType("apa");            
> 
> JestResult result;
> try {
> result = client.execute(search);
> 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;  
> }
> 
> ```
> }
> 
> ```
> 
> Den måndagen den 3:e juni 2013 kl. 21:36:17 UTC+2 skrev David Pilato:
> 
> > How do you search?
> > 
> > BTW, please avoid spaces and uppercase characters in cluster name. It  
> > could works, but I would really avoid to use _special chars_.
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | \*[Elasticsearch.com](http://Elasticsearch.com)[http://elasticsearch.com/](http://elasticsearch.com/)  
> > \*  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 3 juin 2013 à 21:25, Kya W [kyawolf...@gmail.com](mailto:kyawolf...@gmail.com) a écrit :
> > 
> > ```
> > Settings settings = ImmutableSettings.settingsBuilder()
> > .put("cluster.name", "Emmas Cluster").build();
> > 
> > ```
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> 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:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [June 4, 2013, 7:07am UTC](https://discuss.elastic.co/t/query-returns-the-same-document-7-times/12228/20 "2013-06-04T07:07:59Z")

</div>

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.  
[http://mobz.github.io/elasticsearch-head/](http://mobz.github.io/elasticsearch-head/)

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