|
Hi,
I am getting the facets in a search, but I have a problem, the capital letters of the terms are always lowercase, so Elastic Search and the app I am trying to integrate can't understand each other (actually, the app can't understand ES). I mean, I get something like "facets":{ "name":{"_type":"terms","missing":0,"total":9,"other":0,"terms":[ {"term":"myownfile","count":6}, {"term":"myarticle","count":2}, {"term":"mypost","count":1} ]} } when it should be "facets":{ "name":{"_type":"terms","missing":0,"total":9,"other":0,"terms":[ {"term":"myOwnFile","count":6}, {"term":"myArticle","count":2}, {"term":"myPost","count":1} ]} } I checked that I am storing "myOwnFile", "myArticle" and "myPost" from the app in ES. How can I fix that? Thanks!! |
|
You have to change the mapping for these fields and for example use a Keyword analyzer: http://www.elasticsearch.org/guide/reference/index-modules/analysis/keyword-analyzer.html
HTH
-- -- Le 15 févr. 2013 à 19:26, elastray <[hidden email]> a écrit : Hi, 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
The problem is that sometimes I will be able to map them correctly but others it is going to be impossible.
Could it be fixed using templates? (mappings and templates was what was left for the end )
Thanks!! |
|
In reply to this post by dadoonet
Not sure to understand your question here. Define whatever analyzer for your search and Keyword analyzer for facets. And compute facets on yourfield.facet. Does it help? -- Le 15 févr. 2013 à 19:35, David Pilato <[hidden email]> a écrit :
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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
Perhaps the problem is that I am not sure if I understand the mappings.
![]() What I am doing is replace Solr by ES. So I have the Solr schema and i have to create the mapping, I have in Solr something like <field name="title" type="text" indexed="true" stored="true" /> <field name="description" type="text" indexed="true" stored="true" /> <dynamicField name="*Name" type="string" indexed="true" multiValued="true" stored="true" /> <defaultSearchField>description</defaultSearchField> with searchschemer I get { "mappings" : { "type" : { "properties" : { "title" : { "type" : "string", "store" : "yes", "index" : "analyzed" }, "description" : { "type" : "string", "store" : "yes", "index" : "analyzed" } }, "dynamic_templates" : [ { "template_" : { "match" : "*Name", "match_mapping_type" : "string", "mapping" : { "type" : "string", "store" : "yes", "index" : "not_analyzed" } } } ] } } } At this point, I do not understand 1) What happens with defaultSearchField. Perhaps it doesn't matter. 2) How I use the mapping? I don't get how map the type... I have a lot of different types of objects... 3) What I do with the dynamic_templates. Any help appreciated!!! Regards! |
|
Your issue is that the field you facet on needs to be not_analyzed, but sometimes you need this field to be analyzed as well. David's suggestion of multi field is the best solution: Your mapping is syntactically correct, but needs to be modified. Are you faceting on the dynamic fields? I have never tried, but multi fields should work with dynamic templates. "dynamic_templates": [ { "template_": { "match": "*Name", "match_mapping_type": "string",
"mapping": { "type": "multi_field", "fields": { "touched": { "type": "string", "index": "analyzed" },
"untouched": { "type": "string", "index": "not_analyzed" } } } } } ] The field names will change, so you need to adjust your queries. -- Ivan
On Fri, Feb 15, 2013 at 11:47 AM, elastray <[hidden email]> wrote: Perhaps the problem is that I am not sure if I understand the mappings. 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
| Powered by Nabble | Edit this page |
