# Issues with search on multi\_field field

**URL:** <https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947>\
**Category:** Elasticsearch\
**Created:** [February 28, 2013, 9:09am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947 "2013-02-28T09:09:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [February 28, 2013, 9:09am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/1 "2013-02-28T09:09:28Z")

</div>

Hi all,

I'm having issues with searching the analyzed and not\_analyzed fields in a  
multi\_field object (using ES 0.20.4):

I've created a gist here:

> <https://gist.github.com/derryos/2218785ca960e3a4f30f>

The gist workflow is:

1. Create an index with language analyzers configured
2. Create an index type with a multi\_field value which is split into  
analyzed and not\_analyzed. (note the analyzer is based on another field  
value called language)
3. Try and search for terms using the analyzed field (different results  
returned depending on on which language is set for indexing/search)
4. Try and search for terms using the not\_analyzed field (should get more  
results due to lack of language analysis).
5. Recreate my mapping to try and force ES to store/index the 'raw' field  
part of the multi\_field

I've having trouble doing the searches with the unanalyzed fields - as per  
kimchy's example here:

> <https://gist.github.com/kimchy/1296043>

This all works but if i change the last line to be:  
curl -XGET localhost:9200/test/\_search?q=name.untouched:me  
rather than:  
curl -XGET localhost:9200/test/\_search?q=name.untouched:\*

I get 0 results. What i want is the ability to search over the untouched  
fields also with terms.

Any help greatly appreciated.

Derry

--  
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:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [February 28, 2013, 9:16am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/2 "2013-02-28T09:16:03Z")

</div>

Sorry, think i may have answered my own question (a little)!

If i search for:  
curl -XGET localhost:9200/test/\_search?q=name.untouched:"test me"

I get the result back (i.e. the whole not\_analyzed) stores the entire text  
as 1 token. In my use case (if i want to expose "test" in the search and  
"me" in the search, would stop/simple/whitespace be a better solution than  
non analyzed?

On 28 February 2013 09:09, Derry O' Sullivan [derryos@gmail.com](mailto:derryos@gmail.com) wrote:

> Hi all,
> 
> I'm having issues with searching the analyzed and not\_analyzed fields in a  
> multi\_field object (using ES 0.20.4):
> 
> I've created a gist here:  
> [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)
> 
> The gist workflow is:
> 
> 1. Create an index with language analyzers configured
> 2. Create an index type with a multi\_field value which is split into  
> analyzed and not\_analyzed. (note the analyzer is based on another field  
> value called language)
> 3. Try and search for terms using the analyzed field (different results  
> returned depending on on which language is set for indexing/search)
> 4. Try and search for terms using the not\_analyzed field (should get more  
> results due to lack of language analysis).
> 5. Recreate my mapping to try and force ES to store/index the 'raw' field  
> part of the multi\_field
> 
> I've having trouble doing the searches with the unanalyzed fields - as per  
> kimchy's example here:  
> [gist:1296043 · GitHub](https://gist.github.com/kimchy/1296043)
> 
> This all works but if i change the last line to be:  
> curl -XGET localhost:9200/test/\_search?q=name.untouched:me  
> rather than:  
> curl -XGET localhost:9200/test/\_search?q=name.untouched:\*
> 
> I get 0 results. What i want is the ability to search over the untouched  
> fields also with terms.
> 
> Any help greatly appreciated.
> 
> Derry
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, 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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 28, 2013, 6:19pm UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/3 "2013-02-28T18:19:12Z")

</div>

Why not simply search on the "name" field which is analyzed?

The default (standard) analyzer will tokenize on common word boundaries,  
plus lowercase and stop filters. The choice if analyzer depends on your  
goals.

On Thu, Feb 28, 2013 at 1:16 AM, Derry O' Sullivan [derryos@gmail.com](mailto:derryos@gmail.com)wrote:

> Sorry, think i may have answered my own question (a little)!
> 
> If i search for:  
> curl -XGET localhost:9200/test/\_search?q=name.untouched:"test me"
> 
> I get the result back (i.e. the whole not\_analyzed) stores the entire text  
> as 1 token. In my use case (if i want to expose "test" in the search and  
> "me" in the search, would stop/simple/whitespace be a better solution than  
> non analyzed?
> 
> On 28 February 2013 09:09, Derry O' Sullivan [derryos@gmail.com](mailto:derryos@gmail.com) wrote:
> 
> > Hi all,
> > 
> > I'm having issues with searching the analyzed and not\_analyzed fields in  
> > a multi\_field object (using ES 0.20.4):
> > 
> > I've created a gist here:  
> > [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)
> > 
> > The gist workflow is:
> > 
> > 1. Create an index with language analyzers configured
> > 2. Create an index type with a multi\_field value which is split into  
> > analyzed and not\_analyzed. (note the analyzer is based on another field  
> > value called language)
> > 3. Try and search for terms using the analyzed field (different results  
> > returned depending on on which language is set for indexing/search)
> > 4. Try and search for terms using the not\_analyzed field (should get more  
> > results due to lack of language analysis).
> > 5. Recreate my mapping to try and force ES to store/index the 'raw' field  
> > part of the multi\_field
> > 
> > I've having trouble doing the searches with the unanalyzed fields - as  
> > per kimchy's example here:  
> > [gist:1296043 · GitHub](https://gist.github.com/kimchy/1296043)
> > 
> > This all works but if i change the last line to be:  
> > curl -XGET localhost:9200/test/\_search?q=name.untouched:me  
> > rather than:  
> > curl -XGET localhost:9200/test/\_search?q=name.untouched:\*
> > 
> > I get 0 results. What i want is the ability to search over the untouched  
> > fields also with terms.
> > 
> > Any help greatly appreciated.
> > 
> > Derry
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, 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).

--  
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 1, 2013, 1:22pm UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/4 "2013-03-01T13:22:50Z")

</div>

Hi Derry

> I'm having issues with searching the analyzed and not\_analyzed fields  
> in a multi\_field object (using ES 0.20.4):
> 
> I've created a gist here:  
> [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)

You've misunderstood not\_analyzed fields.

not\_analyzed fields index the exact value in the field, so eg:

"The quick brown fox" -\>  
analyzed: ["quick","brown","fox"]  
not\_analyzed: ["The quick brown fox"]

So the only search that will work on the not\_analyzed field is a search  
for "The quick brown fox". Even "the quick brown fox" won't work,  
because the case is different

clint

> The gist workflow is:
> 
> 1. Create an index with language analyzers configured
> 2. Create an index type with a multi\_field value which is split into  
> analyzed and not\_analyzed. (note the analyzer is based on another  
> field value called language)
> 3. Try and search for terms using the analyzed field (different  
> results returned depending on on which language is set for  
> indexing/search)
> 4. Try and search for terms using the not\_analyzed field (should get  
> more results due to lack of language analysis).
> 5. Recreate my mapping to try and force ES to store/index the 'raw'  
> field part of the multi\_field
> 
> I've having trouble doing the searches with the unanalyzed fields - as  
> per kimchy's example here:  
> [gist:1296043 · GitHub](https://gist.github.com/kimchy/1296043)
> 
> This all works but if i change the last line to be:  
> curl -XGET localhost:9200/test/\_search?q=name.untouched:me
> 
> rather than:  
> curl -XGET localhost:9200/test/\_search?q=name.untouched:\*
> 
> I get 0 results. What i want is the ability to search over the  
> untouched fields also with terms.
> 
> Any help greatly appreciated.
> 
> Derry
> 
> --  
> 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:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [March 4, 2013, 10:34am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/5 "2013-03-04T10:34:13Z")

</div>

Hi Clint, Ivan,

Thanks for the fast response.

Clint, i thought that not\_analyzed mean more 'simple' analysis so thanks  
for the clarification.

My use case is that i insert content into elasticsearch based on automatic  
language detection (e.g. tika, user input, or other language setting  
measures). This happens automatically so i have no idea what the  
index\_analyzer (set on the language field) is going to be when the content  
is ingested. When i go to use the content (in search), i want to use a  
'best fit' analyzer or else the language analyzer a user specifies in  
search. (so my real question is how do i solve someone searching in a  
potentially different language to the language that some relevant content  
has been inserted with)

My logic on using multi field was that i was going to have the content  
analyzed in the (hopefully) correct language and then a catch all version  
of the content (sounds to me like this should be standard or something  
simpler?) which is language ambiguous.

Therefore if i go to search the content using a search analyzer in a  
different language to the index analyzer, i could have some chance of  
getting some text matching (although i'm guessing that i would need to do 2  
searches - one with the 'best fit' analyzer' and one with the catch all  
analyzer?

Thanks again,

Derry

On Friday, 1 March 2013 13:22:50 UTC, Clinton Gormley wrote:

> Hi Derry
> 
> > I'm having issues with searching the analyzed and not\_analyzed fields  
> > in a multi\_field object (using ES 0.20.4):
> > 
> > I've created a gist here:  
> > [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)
> 
> You've misunderstood not\_analyzed fields.
> 
> not\_analyzed fields index the exact value in the field, so eg:
> 
> "The quick brown fox" -\>  
> analyzed: ["quick","brown","fox"]  
> not\_analyzed: ["The quick brown fox"]
> 
> So the only search that will work on the not\_analyzed field is a search  
> for "The quick brown fox". Even "the quick brown fox" won't work,  
> because the case is different
> 
> clint
> 
> > The gist workflow is:
> > 
> > 1. Create an index with language analyzers configured
> > 2. Create an index type with a multi\_field value which is split into  
> > analyzed and not\_analyzed. (note the analyzer is based on another  
> > field value called language)
> > 3. Try and search for terms using the analyzed field (different  
> > results returned depending on on which language is set for  
> > indexing/search)
> > 4. Try and search for terms using the not\_analyzed field (should get  
> > more results due to lack of language analysis).
> > 5. Recreate my mapping to try and force ES to store/index the 'raw'  
> > field part of the multi\_field
> > 
> > I've having trouble doing the searches with the unanalyzed fields - as  
> > per kimchy's example here:  
> > [gist:1296043 · GitHub](https://gist.github.com/kimchy/1296043)
> > 
> > This all works but if i change the last line to be:  
> > curl -XGET localhost:9200/test/\_search?q=name.untouched:me
> > 
> > rather than:  
> > curl -XGET localhost:9200/test/\_search?q=name.untouched:\*
> > 
> > I get 0 results. What i want is the ability to search over the  
> > untouched fields also with terms.
> > 
> > Any help greatly appreciated.
> > 
> > Derry
> > 
> > --  
> > 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:** ![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 4, 2013, 10:44am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/6 "2013-03-04T10:44:32Z")

</div>

> My logic on using multi field was that i was going to have the content  
> analyzed in the (hopefully) correct language and then a catch all  
> version of the content (sounds to me like this should be standard or  
> something simpler?) which is language ambiguous.

So yes - use one field with just the "standard" analyzer.

> Therefore if i go to search the content using a search analyzer in a  
> different language to the index analyzer, i could have some chance of  
> getting some text matching (although i'm guessing that i would need to  
> do 2 searches - one with the 'best fit' analyzer' and one with the  
> catch all analyzer?

You don't need two queries, just two query clauses. Or even a  
multi\_match query that looks at both fields, and can assign them  
different boosts

clint

> Thanks again,
> 
> Derry
> 
> On Friday, 1 March 2013 13:22:50 UTC, Clinton Gormley wrote:  
> Hi Derry  
> \>  
> \>  
> \> I'm having issues with searching the analyzed and  
> not\_analyzed fields  
> \> in a multi\_field object (using ES 0.20.4):  
> \>  
> \>  
> \> I've created a gist here:  
> \> [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)
> 
> ```
> You've misunderstood not_analyzed fields. 
>     
> not_analyzed fields index the exact value in the field, so
> eg: 
>     
> "The quick brown fox" -> 
> analyzed: ["quick","brown","fox"] 
> not_analyzed: ["The quick brown fox"] 
>     
> So the only search that will work on the not_analyzed field is
> a search 
> for "The quick brown fox". Even "the quick brown fox" won't
> work, 
> because the case is different 
>     
> clint 
>       
> > 
> > 
> > 
> > The gist workflow is: 
> > 1. Create an index with language analyzers configured 
> > 2. Create an index type with a multi_field value which is
> split into 
> > analyzed and not_analyzed. (note the analyzer is based on
> another 
> > field value called language) 
> > 3. Try and search for terms using the analyzed field
> (different 
> > results returned depending on on which language is set for 
> > indexing/search) 
> > 4. Try and search for terms using the not_analyzed field
> (should get 
> > more results due to lack of language analysis). 
> > 5. Recreate my mapping to try and force ES to store/index
> the 'raw' 
> > field part of the multi_field 
> > 
> > 
> > I've having trouble doing the searches with the unanalyzed
> fields - as 
> > per kimchy's example here: 
> > https://gist.github.com/kimchy/1296043 
> > 
> > 
> > 
> > This all works but if i change the last line to be: 
> > curl -XGET localhost:9200/test/_search?q=name.untouched:me 
> > 
> > rather than: 
> > curl -XGET localhost:9200/test/_search?q=name.untouched:* 
> > 
> > 
> > 
> > I get 0 results. What i want is the ability to search over
> the 
> > untouched fields also with terms. 
> > 
> > 
> > 
> > Any help greatly appreciated. 
> > 
> > 
> > Derry 
> > 
> > -- 
> > 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. 
> >   
> >   
> 
> ```
> 
> --  
> 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:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [March 4, 2013, 11:32am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/7 "2013-03-04T11:32:54Z")

</div>

Thanks for the fast response!

So (just to clarify) you are saying to index in both language driven and  
standard analyzer e.g.:

and then search (using multimatch) in both language driven and the standard  
analyzer with a boost on the language driven query within the multimatch?

e.g:

curl -XPUT '[http://localhost:9200/items/testLanguage/\_mapping](http://localhost:9200/items/testLanguage/_mapping)' -d'{  
"testLanguage" : {  
"\_analyzer" : {  
"path" : "language"  
},  
"properties" : {  
"name" : {  
"type" : "multi\_field",  
"fields" : {  
"name" : {"type" : "string", "index" : "analyzed"},  
"untouched" : {"type" : "string", "index" : "analyzed", "index\_analyzer" : "standard"}  
}  
},  
"language" : {  
"type" : "string",  
"index":"not\_analyzed"  
}  
}  
}  
}'

and then in the search do something like:

{  
"multi\_match" : {  
"query" : ,  
"fields" : ["name, "untouched"]  
}  
}

?

Cheers,

Derry

On Monday, 4 March 2013 10:44:32 UTC, Clinton Gormley wrote:

> > My logic on using multi field was that i was going to have the content  
> > analyzed in the (hopefully) correct language and then a catch all  
> > version of the content (sounds to me like this should be standard or  
> > something simpler?) which is language ambiguous.
> 
> So yes - use one field with just the "standard" analyzer.
> 
> > Therefore if i go to search the content using a search analyzer in a  
> > different language to the index analyzer, i could have some chance of  
> > getting some text matching (although i'm guessing that i would need to  
> > do 2 searches - one with the 'best fit' analyzer' and one with the  
> > catch all analyzer?
> 
> You don't need two queries, just two query clauses. Or even a  
> multi\_match query that looks at both fields, and can assign them  
> different boosts
> 
> clint
> 
> > Thanks again,
> > 
> > Derry
> > 
> > On Friday, 1 March 2013 13:22:50 UTC, Clinton Gormley wrote:  
> > Hi Derry  
> > \>  
> > \>  
> > \> I'm having issues with searching the analyzed and  
> > not\_analyzed fields  
> > \> in a multi\_field object (using ES 0.20.4):  
> > \>  
> > \>  
> > \> I've created a gist here:  
> > \> [Trying to do language specific searching with multi\_field in ES · GitHub](https://gist.github.com/derryos/2218785ca960e3a4f30f)
> > 
> > ```
> > You've misunderstood not_analyzed fields. 
> >     
> > not_analyzed fields index the exact value in the field, so 
> > eg: 
> >     
> > "The quick brown fox" -> 
> > analyzed: ["quick","brown","fox"] 
> > not_analyzed: ["The quick brown fox"] 
> >     
> > So the only search that will work on the not_analyzed field is 
> > a search 
> > for "The quick brown fox". Even "the quick brown fox" won't 
> > work, 
> > because the case is different 
> >     
> > clint 
> >       
> > > 
> > > 
> > > 
> > > The gist workflow is: 
> > > 1. Create an index with language analyzers configured 
> > > 2. Create an index type with a multi_field value which is 
> > split into 
> > > analyzed and not_analyzed. (note the analyzer is based on 
> > another 
> > > field value called language) 
> > > 3. Try and search for terms using the analyzed field 
> > (different 
> > > results returned depending on on which language is set for 
> > > indexing/search) 
> > > 4. Try and search for terms using the not_analyzed field 
> > (should get 
> > > more results due to lack of language analysis). 
> > > 5. Recreate my mapping to try and force ES to store/index 
> > the 'raw' 
> > > field part of the multi_field 
> > > 
> > > 
> > > I've having trouble doing the searches with the unanalyzed 
> > fields - as 
> > > per kimchy's example here: 
> > > https://gist.github.com/kimchy/1296043 
> > > 
> > > 
> > > 
> > > This all works but if i change the last line to be: 
> > > curl -XGET localhost:9200/test/_search?q=name.untouched:me 
> > > 
> > > rather than: 
> > > curl -XGET localhost:9200/test/_search?q=name.untouched:* 
> > > 
> > > 
> > > 
> > > I get 0 results. What i want is the ability to search over 
> > the 
> > > untouched fields also with terms. 
> > > 
> > > 
> > > 
> > > Any help greatly appreciated. 
> > > 
> > > 
> > > Derry 
> > > 
> > > -- 
> > > 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. 
> > >   
> > >   
> > 
> > ```
> > 
> > --  
> > 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:** ![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 4, 2013, 12:04pm UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/8 "2013-03-04T12:04:49Z")

</div>

> {  
> "multi\_match" : {  
> "query" : ,  
> "fields" : ["name, "untouched"]  
> }  
> }

The field would be "name.untouched", but otherwise yes. Also, you can  
boost individual fields like:

```
"field": ["name^2","name.untouched"]

```

clint

> ?
> 
> Cheers,
> 
> Derry
> 
> On Monday, 4 March 2013 10:44:32 UTC, Clinton Gormley wrote:
> 
> ```
> > 
> > My logic on using multi field was that i was going to have
> the content 
> > analyzed in the (hopefully) correct language and then a
> catch all 
> > version of the content (sounds to me like this should be
> standard or 
> > something simpler?) which is language ambiguous. 
>     
> So yes - use one field with just the "standard" analyzer. 
>     
> > 
> > 
> > Therefore if i go to search the content using a search
> analyzer in a 
> > different language to the index analyzer, i could have some
> chance of 
> > getting some text matching (although i'm guessing that i
> would need to 
> > do 2 searches - one with the 'best fit' analyzer' and one
> with the 
> > catch all analyzer? 
>     
> You don't need two queries, just two query clauses. Or even
> a 
> multi_match query that looks at both fields, and can assign
> them 
> different boosts 
>     
> clint 
>     
> > 
> > 
> > Thanks again, 
> > 
> > 
> > Derry 
> > 
> > 
> > 
> > 
> > 
> > On Friday, 1 March 2013 13:22:50 UTC, Clinton Gormley
> wrote: 
> > Hi Derry 
> > > 
> > > 
> > > I'm having issues with searching the analyzed and 
> > not_analyzed fields 
> > > in a multi_field object (using ES 0.20.4): 
> > > 
> > > 
> > > I've created a gist here: 
> > >
> https://gist.github.com/derryos/2218785ca960e3a4f30f 
> >         
> > You've misunderstood not_analyzed fields. 
> >         
> > not_analyzed fields index the exact value in the
> field, so 
> > eg: 
> >         
> > "The quick brown fox" -> 
> > analyzed: ["quick","brown","fox"] 
> > not_analyzed: ["The quick brown fox"] 
> >         
> > So the only search that will work on the
> not_analyzed field is 
> > a search 
> > for "The quick brown fox". Even "the quick brown
> fox" won't 
> > work, 
> > because the case is different 
> >         
> > clint 
> >           
> > > 
> > > 
> > > 
> > > The gist workflow is: 
> > > 1. Create an index with language analyzers
> configured 
> > > 2. Create an index type with a multi_field value
> which is 
> > split into 
> > > analyzed and not_analyzed. (note the analyzer is
> based on 
> > another 
> > > field value called language) 
> > > 3. Try and search for terms using the analyzed
> field 
> > (different 
> > > results returned depending on on which language is
> set for 
> > > indexing/search) 
> > > 4. Try and search for terms using the not_analyzed
> field 
> > (should get 
> > > more results due to lack of language analysis). 
> > > 5. Recreate my mapping to try and force ES to
> store/index 
> > the 'raw' 
> > > field part of the multi_field 
> > > 
> > > 
> > > I've having trouble doing the searches with the
> unanalyzed 
> > fields - as 
> > > per kimchy's example here: 
> > > https://gist.github.com/kimchy/1296043 
> > > 
> > > 
> > > 
> > > This all works but if i change the last line to
> be: 
> > > curl -XGET
> localhost:9200/test/_search?q=name.untouched:me 
> > > 
> > > rather than: 
> > > curl -XGET
> localhost:9200/test/_search?q=name.untouched:* 
> > > 
> > > 
> > > 
> > > I get 0 results. What i want is the ability to
> search over 
> > the 
> > > untouched fields also with terms. 
> > > 
> > > 
> > > 
> > > Any help greatly appreciated. 
> > > 
> > > 
> > > Derry 
> > > 
> > > -- 
> > > 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. 
> > >   
> > >   
> >         
> >         
> > 
> > -- 
> > 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. 
> >   
> >   
> 
> ```
> 
> --  
> 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:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [March 4, 2013, 12:10pm UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/9 "2013-03-04T12:10:57Z")

</div>

Perfect, thanks for that!

On 4 March 2013 12:04, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> > {  
> > "multi\_match" : {  
> > "query" : ,  
> > "fields" : ["name, "untouched"]  
> > }  
> > }
> 
> The field would be "name.untouched", but otherwise yes. Also, you can  
> boost individual fields like:
> 
> ```
> "field": ["name^2","name.untouched"]
> 
> ```
> 
> clint
> 
> > ?
> > 
> > Cheers,
> > 
> > Derry
> > 
> > On Monday, 4 March 2013 10:44:32 UTC, Clinton Gormley wrote:
> > 
> > ```
> > >
> > > My logic on using multi field was that i was going to have
> > the content
> > > analyzed in the (hopefully) correct language and then a
> > catch all
> > > version of the content (sounds to me like this should be
> > standard or
> > > something simpler?) which is language ambiguous.
> > 
> > So yes - use one field with just the "standard" analyzer.
> > 
> > >
> > >
> > > Therefore if i go to search the content using a search
> > analyzer in a
> > > different language to the index analyzer, i could have some
> > chance of
> > > getting some text matching (although i'm guessing that i
> > would need to
> > > do 2 searches - one with the 'best fit' analyzer' and one
> > with the
> > > catch all analyzer?
> > 
> > You don't need two queries, just two query clauses. Or even
> > a
> > multi_match query that looks at both fields, and can assign
> > them
> > different boosts
> > 
> > clint
> > 
> > >
> > >
> > > Thanks again,
> > >
> > >
> > > Derry
> > >
> > >
> > >
> > >
> > >
> > > On Friday, 1 March 2013 13:22:50 UTC, Clinton Gormley
> > wrote:
> > > Hi Derry
> > > >
> > > >
> > > > I'm having issues with searching the analyzed and
> > > not_analyzed fields
> > > > in a multi_field object (using ES 0.20.4):
> > > >
> > > >
> > > > I've created a gist here:
> > > >
> > https://gist.github.com/derryos/2218785ca960e3a4f30f
> > >
> > > You've misunderstood not_analyzed fields.
> > >
> > > not_analyzed fields index the exact value in the
> > field, so
> > > eg:
> > >
> > > "The quick brown fox" ->
> > > analyzed: ["quick","brown","fox"]
> > > not_analyzed: ["The quick brown fox"]
> > >
> > > So the only search that will work on the
> > not_analyzed field is
> > > a search
> > > for "The quick brown fox". Even "the quick brown
> > fox" won't
> > > work,
> > > because the case is different
> > >
> > > clint
> > >
> > > >
> > > >
> > > >
> > > > The gist workflow is:
> > > > 1. Create an index with language analyzers
> > configured
> > > > 2. Create an index type with a multi_field value
> > which is
> > > split into
> > > > analyzed and not_analyzed. (note the analyzer is
> > based on
> > > another
> > > > field value called language)
> > > > 3. Try and search for terms using the analyzed
> > field
> > > (different
> > > > results returned depending on on which language is
> > set for
> > > > indexing/search)
> > > > 4. Try and search for terms using the not_analyzed
> > field
> > > (should get
> > > > more results due to lack of language analysis).
> > > > 5. Recreate my mapping to try and force ES to
> > store/index
> > > the 'raw'
> > > > field part of the multi_field
> > > >
> > > >
> > > > I've having trouble doing the searches with the
> > unanalyzed
> > > fields - as
> > > > per kimchy's example here:
> > > > https://gist.github.com/kimchy/1296043
> > > >
> > > >
> > > >
> > > > This all works but if i change the last line to
> > be:
> > > > curl -XGET
> > localhost:9200/test/_search?q=name.untouched:me
> > > >
> > > > rather than:
> > > > curl -XGET
> > localhost:9200/test/_search?q=name.untouched:*
> > > >
> > > >
> > > >
> > > > I get 0 results. What i want is the ability to
> > search over
> > > the
> > > > untouched fields also with terms.
> > > >
> > > >
> > > >
> > > > Any help greatly appreciated.
> > > >
> > > >
> > > > Derry
> > > >
> > > > --
> > > > 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.
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > 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.
> > >
> > >
> > 
> > ```
> > 
> > --  
> > 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 a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/n8Z9cDpqRz4/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, 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:** ![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:48am UTC](https://discuss.elastic.co/t/issues-with-search-on-multi-field-field/10947/10 "2017-07-06T02:48:37Z")

</div>


