# ElasticSearch Query Issue for Alphanumeric Values

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-issue-for-alphanumeric-values/101145>\
**Category:** Elasticsearch\
**Created:** [September 20, 2017, 10:12am UTC](https://discuss.elastic.co/t/elasticsearch-query-issue-for-alphanumeric-values/101145 "2017-09-20T10:12:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulm6](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rahulm6](https://discuss.elastic.co/u/rahulm6)\
**Post date:** [September 20, 2017, 10:12am UTC](https://discuss.elastic.co/t/elasticsearch-query-issue-for-alphanumeric-values/101145/1 "2017-09-20T10:12:47Z")

</div>

I am new to ElasticSearch NEST and trying to integrate in my application. One issue i am facing while searching with Alphanumeric feild like I have one feild UniqueID whose value starts with 'h' and followed by some integers values and length of the feild value is 11.

For Example :  
UniqueID  
h4212423321  
h4212423122  
h4212413323  
h4212421324  
h4212423225  
h4212423316

Like this i have more than 100000 records data to be indexed.

Problem : When i search for UniqueID='h', I am getting max 250 results only, But all the 100000 records startswith 'h'. So all records should come. I need help in searching all data.

Please find the my Query Code :

```
var result = client.Search<MemberListDto>(s => s
                   .Size(10000)
                   .Query(q =>
                               q.MatchPhrasePrefix((mq => mq.Field(f => f.UniqueID).Query(UniqueID))) 
                       ));

```

return result.Total;

My POCO c# class for this is

```
    public class MemberListDto
{
    [String(Analyzer = "keyword", SearchAnalyzer = "keyword")]
    public string UniqueID { get; set; }

    [String(Analyzer = "keyword", SearchAnalyzer = "keyword")]
    public string SubscriberID { get; set; }

```

}

My Method to index list of MemberListDto is :  
public void CreateBulkIndex(List data, string indexName, string typeName) where T : class  
{

```
        if (!_client.IndexExists(ElasticConfig.IndexName).Exists)
        {
            var indexDescriptor = new CreateIndexDescriptor(ElasticConfig.IndexName)
                .Mappings(ms => ms
                    .Map<T>(m => m.AutoMap()));
           
            _client.CreateIndex(ElasticConfig.IndexName, i => indexDescriptor);
        }
        _client.Bulk(b => b.IndexMany(data, (d, doc) => d.Document(doc).Index(indexName)));
        
    }
```

---

<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:** [October 18, 2017, 10:12am UTC](https://discuss.elastic.co/t/elasticsearch-query-issue-for-alphanumeric-values/101145/2 "2017-10-18T10:12:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
