Completion type & multi-type dynamic template


(Jilles van Gurp) #1

I'm playing with the new completion functionality as introduced here:

For this, I'm running a fresh build straight of es master with the new
functionality.

In my data, the json includes things like this:

"name":{"it":["Berlino"],"de":["Berlin", "Stadt Berlin"]}

So, it is an object with language -> list of translations. If I index with
a dynamic mapping, I would end up with the fields name.it and name.de

Instead, I'm trying to use dynamic templates and multi_field together to do
this:

    "dynamic_templates": [
        {
            "name_string": {
                "path_match": "name.*",
                "match_mapping_type": "string",
                "mapping": {
                    "type": "multi_field",
                    "path": "just_name",
                    "fields": {
                        "name_value": {
                            "type" : "string", 
                            "index" : "analyzed"
                        },
                        "name_completion": {
                            "type" : "completion"
                        },                            
                        "{name}": { 
                            "type" : "string", 
                            "index" : "analyzed"
                        },
                        "name_value_na": { 
                            "type" : "string", 
                            "index" : "not_analyzed"
                        }
                    }
                }
            }
        }

The intention is to have my different name translations indexed in several
ways:

a name_value field that indexes all language strings regardless of their
language. (I'm using the icu plugin and have that configured as the default
analyzer elsewhere)
a name_value_na field that indexes all language strings regardless of their
mapping but without the analyzer.
a name. field for which I plan to have language specific analysis
eventually.
a name_completion that uses the new suggestions functionality (I'm building
directly from master & updated this morning)

My problem is with the completion field:

11:46:02.342 [elasticsearch[localnode][refresh][T#1]] WARN index.codec -
[localnode] [locations] no index mapper found for field:
[name.de.name_completion] returning default postings format

It seems to be trying to create a name..name_completion instead
of the name_completion despite the fact that I specified "path":
"just_name". Is this a bug or am I doing something wrong here?

Jilles

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(Igor Motov) #2

Looks like a bug https://github.com/elasticsearch/elasticsearch/issues/3669

On Wednesday, September 11, 2013 6:02:28 AM UTC-4, Jilles van Gurp wrote:

I'm playing with the new completion functionality as introduced here:
http://www.elasticsearch.org/blog/you-complete-me/

For this, I'm running a fresh build straight of es master with the new
functionality.

In my data, the json includes things like this:

"name":{"it":["Berlino"],"de":["Berlin", "Stadt Berlin"]}

So, it is an object with language -> list of translations. If I index with
a dynamic mapping, I would end up with the fields name.it and name.de

Instead, I'm trying to use dynamic templates and multi_field together to
do this:

    "dynamic_templates": [
        {
            "name_string": {
                "path_match": "name.*",
                "match_mapping_type": "string",
                "mapping": {
                    "type": "multi_field",
                    "path": "just_name",
                    "fields": {
                        "name_value": {
                            "type" : "string", 
                            "index" : "analyzed"
                        },
                        "name_completion": {
                            "type" : "completion"
                        },                            
                        "{name}": { 
                            "type" : "string", 
                            "index" : "analyzed"
                        },
                        "name_value_na": { 
                            "type" : "string", 
                            "index" : "not_analyzed"
                        }
                    }
                }
            }
        }

The intention is to have my different name translations indexed in several
ways:

a name_value field that indexes all language strings regardless of their
language. (I'm using the icu plugin and have that configured as the default
analyzer elsewhere)
a name_value_na field that indexes all language strings regardless of
their mapping but without the analyzer.
a name. field for which I plan to have language specific
analysis eventually.
a name_completion that uses the new suggestions functionality (I'm
building directly from master & updated this morning)

My problem is with the completion field:

11:46:02.342 [elasticsearch[localnode][refresh][T#1]] WARN index.codec -
[localnode] [locations] no index mapper found for field:
[name.de.name_completion] returning default postings format

It seems to be trying to create a name..name_completion instead
of the name_completion despite the fact that I specified "path":
"just_name". Is this a bug or am I doing something wrong here?

Jilles

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3