Can't get path_hierarchy tokenizer working

Hi all,

I have a default-mapping.json like so:

{
"default" : {
"dynamic_templates" : [
{
"template_1" : {
"match" : "folder",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : {
"analysis" : {
"analyzer_keyword" : {
"tokenizer" : "path_hierarchy"
}
}
}
}
}
},
{
"template_2" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
]
}
}

When I try indexing a doc, I get this:

failed to execute bulk item (index) index {[fury][product][guid1],
source[{"guid": "guid1", "timestamp": 1369982103, "folder":
"/tox/seq1/shot1/chicken/3", "version": 3}]}
org.elasticsearch.index.mapper.MapperParsingException: Wrong value for
index [{analysis={analyzer_keyword={tokenizer=path_hierarchy}}}] for field
[folder]

I don't understand what the problem is - the folder field is a string, what
then does "wrong value for index" refer to? The documentation doesn't make
configuration of mappings very clear.

Thanks,
Allan

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

Ok I think the structure of my json here is a bit wrong. But, I can't work
out where I'm supposed to define my analyzer so that I can refer to it in
default-mappings.json. I just need to refer to a path_hierarchy analyzer.
How do I do this?

thanks
A

On Fri, May 31, 2013 at 4:43 PM, Allan Johns nerdvegas@gmail.com wrote:

Hi all,

I have a default-mapping.json like so:

{
"default" : {
"dynamic_templates" : [
{
"template_1" : {
"match" : "folder",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : {
"analysis" : {
"analyzer_keyword" : {
"tokenizer" : "path_hierarchy"
}
}
}
}
}
},
{
"template_2" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
]
}
}

When I try indexing a doc, I get this:

failed to execute bulk item (index) index {[fury][product][guid1],
source[{"guid": "guid1", "timestamp": 1369982103, "folder":
"/tox/seq1/shot1/chicken/3", "version": 3}]}
org.elasticsearch.index.mapper.MapperParsingException: Wrong value for
index [{analysis={analyzer_keyword={tokenizer=path_hierarchy}}}] for field
[folder]

I don't understand what the problem is - the folder field is a string,
what then does "wrong value for index" refer to? The documentation doesn't
make configuration of mappings very clear.

Thanks,
Allan

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

Define your analyzer separately and then use

On Fri, May 31, 2013 at 12:18 AM, Allan Johns nerdvegas@gmail.com wrote:

Ok I think the structure of my json here is a bit wrong. But, I can't work
out where I'm supposed to define my analyzer so that I can refer to it in
default-mappings.json. I just need to refer to a path_hierarchy analyzer.
How do I do this?

thanks
A

On Fri, May 31, 2013 at 4:43 PM, Allan Johns nerdvegas@gmail.com wrote:

Hi all,

I have a default-mapping.json like so:

{
"default" : {
"dynamic_templates" : [
{
"template_1" : {
"match" : "folder",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : {
"analysis" : {
"analyzer_keyword" : {
"tokenizer" : "path_hierarchy"
}
}
}
}
}
},
{
"template_2" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
]
}
}

When I try indexing a doc, I get this:

failed to execute bulk item (index) index {[fury][product][guid1],
source[{"guid": "guid1", "timestamp": 1369982103, "folder":
"/tox/seq1/shot1/chicken/3", "version": 3}]}
org.elasticsearch.index.mapper.MapperParsingException: Wrong value for
index [{analysis={analyzer_keyword={tokenizer=path_hierarchy}}}] for field
[folder]

I don't understand what the problem is - the folder field is a string,
what then does "wrong value for index" refer to? The documentation doesn't
make configuration of mappings very clear.

Thanks,
Allan

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

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

Sorry, submitting by mistake.

Define your analyzer separately and then use the analyzer like with any
other field.

"mapping" : {
"type" : "string",
"analyzer" : "analyzer_keyword"
}

On Fri, May 31, 2013 at 11:48 AM, Ivan Brusic ivan@brusic.com wrote:

Define your analyzer separately and then use

On Fri, May 31, 2013 at 12:18 AM, Allan Johns nerdvegas@gmail.com wrote:

Ok I think the structure of my json here is a bit wrong. But, I can't
work out where I'm supposed to define my analyzer so that I can refer to it
in default-mappings.json. I just need to refer to a path_hierarchy
analyzer. How do I do this?

thanks
A

On Fri, May 31, 2013 at 4:43 PM, Allan Johns nerdvegas@gmail.com wrote:

Hi all,

I have a default-mapping.json like so:

{
"default" : {
"dynamic_templates" : [
{
"template_1" : {
"match" : "folder",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : {
"analysis" : {
"analyzer_keyword" : {
"tokenizer" : "path_hierarchy"
}
}
}
}
}
},
{
"template_2" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
]
}
}

When I try indexing a doc, I get this:

failed to execute bulk item (index) index {[fury][product][guid1],
source[{"guid": "guid1", "timestamp": 1369982103, "folder":
"/tox/seq1/shot1/chicken/3", "version": 3}]}
org.elasticsearch.index.mapper.MapperParsingException: Wrong value for
index [{analysis={analyzer_keyword={tokenizer=path_hierarchy}}}] for field
[folder]

I don't understand what the problem is - the folder field is a string,
what then does "wrong value for index" refer to? The documentation doesn't
make configuration of mappings very clear.

Thanks,
Allan

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

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