# Searching the \_all field and getting 0 hits with ikanalyzer

**URL:** <https://discuss.elastic.co/t/searching-the--all-field-and-getting-0-hits-with-ikanalyzer/8162>\
**Category:** Elasticsearch\
**Created:** [June 20, 2012, 1:56am UTC](https://discuss.elastic.co/t/searching-the--all-field-and-getting-0-hits-with-ikanalyzer/8162 "2012-06-20T01:56:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![exapted](https://avatars.discourse-cdn.com/v4/letter/e/f19dbf/32.png) [@exapted](https://discuss.elastic.co/u/exapted)\
**Post date:** [June 20, 2012, 1:56am UTC](https://discuss.elastic.co/t/searching-the--all-field-and-getting-0-hits-with-ikanalyzer/8162/1 "2012-06-20T01:56:56Z")

</div>

I am able to search for terms in individual fields, but I'm unable to get  
any results when searching the \_all field. (See note below about how I am  
searching.)

* * *

# I've tried setting ik analyzer as the analyzer for the \_all field, as

follows:

```
    "_all":
    {
        "enabled": true,
        "indexAnalyzer": "ik",
        "searchAnalyzer": "ik",
        "term_vector": "with_positions_offsets",
        "store": false
    },

```

* * *

# The fields included in \_all are as follows:

```
        "message":
        {
            "type":"string",
            "store": "no",
            "term_vector": "with_positions_offsets",
            "indexAnalyzer": "ik",
            "searchAnalyzer": "ik",
            "include_in_all": true,
            "boost": 8
        },
        "title":
        {
            "type":"string",
            "store": "no",
            "term_vector": "with_positions_offsets",
            "indexAnalyzer": "ik",
            "searchAnalyzer": "ik",
            "include_in_all": true,
            "boost": 8
        },

```

* * *

When I try to search for stuff in 'title' or 'message', I get hits. When I  
try to search \_all, I get nothing.

Note that I am using the Elasticsearch Head plugin for searching. I haven't  
looked into searching as much as indexing, and I wonder if the Head  
frontend is somehow screwing up the search analyzer settings.

* * *

# As a final step I tried setting ik analyzer as the default analyzer:

index.analysis.analyzer.default.type: ik

* * *

# All along, fhe following has been in my elasticsearch.yml:

index:  
analysis:  
analyzer:  
ik:  
alias: [ik\_analyzer]  
type: org.elasticsearch.index.analysis.IkAnalyzerProvider

# and ik analyzer is installed as per the instructions.

* * *

Now that I think of it, I think I should at least get _some_ results when  
searching the \_all field. It seems that nothing is getting indexed in \_all.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 21, 2012, 7:38am UTC](https://discuss.elastic.co/t/searching-the--all-field-and-getting-0-hits-with-ikanalyzer/8162/2 "2012-06-21T07:38:55Z")

</div>

It should work, is IkAnalyzer a custom one you built? Can you try it with a  
different built in analyzer and see if it works?

On Wed, Jun 20, 2012 at 3:56 AM, exapted [benmerrill@gmail.com](mailto:benmerrill@gmail.com) wrote:

> I am able to search for terms in individual fields, but I'm unable to get  
> any results when searching the \_all field. (See note below about how I am  
> searching.)
> 
> * * *
> 
> # I've tried setting ik analyzer as the analyzer for the \_all field, as
> 
> follows:
> 
> ```
> "_all":
> {
> "enabled": true,
> "indexAnalyzer": "ik",
> "searchAnalyzer": "ik",
> "term_vector": "with_positions_offsets",
> "store": false
> },
> 
> ```
> 
> * * *
> 
> # The fields included in \_all are as follows:
> 
> ```
> "message":
> {
> "type":"string",
> "store": "no",
> "term_vector": "with_positions_offsets",
> "indexAnalyzer": "ik",
> "searchAnalyzer": "ik",
> "include_in_all": true,
> "boost": 8
> },
> "title":
> {
> "type":"string",
> "store": "no",
> "term_vector": "with_positions_offsets",
> "indexAnalyzer": "ik",
> "searchAnalyzer": "ik",
> "include_in_all": true,
> "boost": 8
> },
> 
> ```
> 
> * * *
> 
> When I try to search for stuff in 'title' or 'message', I get hits. When I  
> try to search \_all, I get nothing.
> 
> Note that I am using the Elasticsearch Head plugin for searching. I  
> haven't looked into searching as much as indexing, and I wonder if the Head  
> frontend is somehow screwing up the search analyzer settings.
> 
> * * *
> 
> # As a final step I tried setting ik analyzer as the default analyzer:
> 
> index.analysis.analyzer.default.type: ik
> 
> * * *
> 
> # All along, fhe following has been in my elasticsearch.yml:
> 
> index:  
> analysis:  
> analyzer:  
> ik:  
> alias: [ik\_analyzer]  
> type: org.elasticsearch.index.analysis.IkAnalyzerProvider
> 
> # and ik analyzer is installed as per the instructions.
> 
> * * *
> 
> Now that I think of it, I think I should at least get _some_ results when  
> searching the \_all field. It seems that nothing is getting indexed in \_all.
> 
> Any help would be appreciated.

---

<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, 3:23am UTC](https://discuss.elastic.co/t/searching-the--all-field-and-getting-0-hits-with-ikanalyzer/8162/3 "2017-07-06T03:23:10Z")

</div>


