# Inconsistent Results from Index

**URL:** <https://discuss.elastic.co/t/inconsistent-results-from-index/1302>\
**Category:** Elasticsearch\
**Created:** [May 26, 2015, 10:41am UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302 "2015-05-26T10:41:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilivewithian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilivewithian/32/401_2.png) [@ilivewithian](https://discuss.elastic.co/u/ilivewithian)\
**Post date:** [May 26, 2015, 10:41am UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/1 "2015-05-26T10:41:40Z")

</div>

I have two search indexes, to the best of my understanding these indexes have an identical setup, apart from their name. One index has ~1.7 million documents, the other has 8.

The documents have the following structure (this example exists in both indexes):

```
{
    _index: "locations",
    _type: "location",
    _id: "Royal Leamington Spa",
    _version: 1,
    found: true,
    _source: {
        name: "Royal Leamington Spa",
        coordinate: {
            lat: 52.29156048773691,
            lon: -1.5343337101975745
        }
    }
}

```

Both indexes have the same mapping of

```
<indexname>: {
    settings: {
        index: {
            creation_date: "1427477291143",
            uuid: "Z75-HWNGQwiE0MzqezVctQ",
            number_of_replicas: "1",
            number_of_shards: "1",
            version: {
                created: "1040499" //this is slightly different on each
            }
        }
    }
}

```

I am querying both with the following:

```
POST http://<server>/locations/location/_search
{
    "from": 0,
    "size": 10,
    "sort": [
    {
        "_score": {}
    }
    ],
    "query": {
        "match": {
            "name": {
                "type": "phrase_prefix",
                "query": "Royal L"
            }
        }
    }
}

```

The larger of the two indexes returns no results, but the smaller index returns the document I was expecting. What causes the difference in the result and how can I query the larger index in a way that will return results for the given query?

---

<div class="post-metadata">

**Author:** ![Camilo\_Sierra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/camilo_sierra/32/14397_2.png) [@Camilo\_Sierra](https://discuss.elastic.co/u/Camilo_Sierra)\
**Post date:** [May 26, 2015, 12:49pm UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/2 "2015-05-26T12:49:00Z")

</div>

are you already compare the mapping for both index after your indexation? the number of documents can't be the problem! can you show us the mapping for this index ?

[https://www.elastic.co/guide/en/elasticsearch/reference/1.3/indices-get-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.3/indices-get-mapping.html)

---

<div class="post-metadata">

**Author:** ![ilivewithian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilivewithian/32/401_2.png) [@ilivewithian](https://discuss.elastic.co/u/ilivewithian)\
**Post date:** [May 26, 2015, 2:11pm UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/3 "2015-05-26T14:11:53Z")

</div>

The two indexes looks like this, it might be worth noting they are on the same cluster:

```
GET /locations/_mapping/location

```

gives me

```
{
    locations: {
        mappings: {
            location: {
                properties: {
                    coordinate: {
                        type: "geo_point"
                    },
                    name: {
                        type: "string"
                    }
                }
            }
        }
    }
}

```

and

```
GET /searchtestlocations/_mapping/location

```

gives me

```
{
    searchtestlocations: {
        mappings: {
            location: {
                properties: {
                    coordinate: {
                        type: "geo_point"
                    },
                    name: {
                        type: "string"
                    }
                }
           }
        }
    }
}

```

It is possible that there is a server wide config which I'm not accounting for? If so what might I go looking for?

---

<div class="post-metadata">

**Author:** ![Camilo\_Sierra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/camilo_sierra/32/14397_2.png) [@Camilo\_Sierra](https://discuss.elastic.co/u/Camilo_Sierra)\
**Post date:** [May 26, 2015, 2:36pm UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/4 "2015-05-26T14:36:14Z")

</div>

> [@ilivewithian](#):
>
> I am querying both with the following:
> 
> POST http://\<server\>/locations/location/\_search

your type is not the same in both index, are you sure that you change your index type ?

POST http://\<server\>/locations/location/\_search  
and in the other server :  
POST http://\<server\>/searchtestlocations/location/\_search

---

<div class="post-metadata">

**Author:** ![ilivewithian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilivewithian/32/401_2.png) [@ilivewithian](https://discuss.elastic.co/u/ilivewithian)\
**Post date:** [May 27, 2015, 9:03am UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/5 "2015-05-27T09:03:52Z")

</div>

Yes, I definitely change the type.

I don't know if this is relevant, but for short entries in the index I am able to find data in the larger index. For example postcodes, if I search for "RH12 5" I am presented with all the related postcodes, which is exactly the behaviour I'm expecting. For some reason this doesn't work for longer place names.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:11am UTC](https://discuss.elastic.co/t/inconsistent-results-from-index/1302/6 "2017-07-06T00:11:43Z")

</div>


