Searching the _all field and getting 0 hits with ikanalyzer


(exapted) #1

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.


(Shay Banon) #2

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


(system) #3