# Performing a partial word search without wildcards

**URL:** <https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362>\
**Category:** Elasticsearch\
**Created:** [March 28, 2013, 5:57pm UTC](https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362 "2013-03-28T17:57:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazoompa\_3](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@kazoompa\_3](https://discuss.elastic.co/u/kazoompa_3)\
**Post date:** [March 28, 2013, 5:57pm UTC](https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362/1 "2013-03-28T17:57:44Z")

</div>

Hi,

I would like to search for the word 'admin' when almost all the indexed  
values are:

admin  
adminblabla  
admin\_blabla  
adminadminblabla  
blablaadmin  
admin.blabla

Here is my query JSON:

{  
"query": {  
"query\_string": {  
"fields": [  
"name",  
"description\*",  
"label\*"  
],  
"query": "admin"  
}  
},  
"fields": [  
"name",  
"label",  
"fullName"  
],sadasd  
"from": 0,  
"size": 10  
}

I can of course use a wildcard like "admin\*" but I would like to avoid this.

I don't know if the explanations by Clint and Raul in this thread are  
relevant:  
[http://elasticsearch-users.115913.n3.nabble.com/What-is-required-for-partial-match-to-work-td3136814.html#a3144078](http://elasticsearch-users.115913.n3.nabble.com/What-is-required-for-partial-match-to-work-td3136814.html#a3144078)

If they are, can you explain where and how to use the following:

{ content: {  
type: "string",  
index\_analyzer: "ascAnalyzer1",  
search\_analyzer: "default"  
}}

Cheers,  
Ramin

--  
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:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [March 29, 2013, 11:10am UTC](https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362/2 "2013-03-29T11:10:22Z")

</div>

Prefix query is supported -

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

Thanks  
Vineeth

On Thu, Mar 28, 2013 at 11:27 PM, Ramin Haeri Azad [rhaeri@p3g.org](mailto:rhaeri@p3g.org) wrote:

> Hi,
> 
> I would like to search for the word 'admin' when almost all the indexed  
> values are:
> 
> admin  
> adminblabla  
> admin\_blabla  
> adminadminblabla  
> blablaadmin  
> admin.blabla
> 
> Here is my query JSON:
> 
> {  
> "query": {  
> "query\_string": {  
> "fields": [  
> "name",  
> "description\*",  
> "label\*"  
> ],  
> "query": "admin"  
> }  
> },  
> "fields": [  
> "name",  
> "label",  
> "fullName"  
> ],sadasd  
> "from": 0,  
> "size": 10  
> }
> 
> I can of course use a wildcard like "admin\*" but I would like to avoid  
> this.
> 
> I don't know if the explanations by Clint and Raul in this thread are  
> relevant:  
> [http://elasticsearch-users.115913.n3.nabble.com/What-is-required-for-partial-match-to-work-td3136814.html#a3144078](http://elasticsearch-users.115913.n3.nabble.com/What-is-required-for-partial-match-to-work-td3136814.html#a3144078)
> 
> If they are, can you explain where and how to use the following:
> 
> { content: {  
> type: "string",  
> index\_analyzer: "ascAnalyzer1",  
> search\_analyzer: "default"  
> }}
> 
> Cheers,  
> Ramin
> 
> --  
> 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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 29, 2013, 11:47am UTC](https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362/3 "2013-03-29T11:47:28Z")

</div>

On Thu, 2013-03-28 at 10:57 -0700, Ramin Haeri Azad wrote:

> Hi,
> 
> I would like to search for the word 'admin' when almost all the  
> indexed values are:

You need to use ngrams. There are many examples both in this forum and  
on stackoverflow.

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:43am UTC](https://discuss.elastic.co/t/performing-a-partial-word-search-without-wildcards/11362/4 "2017-07-06T02:43:38Z")

</div>


