Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Steps to reproduce using sence or kibana dev tools
- #
- PUT /test_index
- {
- "settings": {
- "number_of_shards": 1,
- "number_of_replicas": 0
- },
- "mappings" : {
- "file" : {
- "properties" : {
- "text" : {
- "type" : "string",
- "analyzer": "danish"
- },
- "level_two_text" : {
- "type": "nested",
- "properties": {
- "text" : {
- "type": "string",
- "analyzer": "danish"
- }
- }
- },
- "level_three_text": {
- "type": "nested",
- "properties": {
- "level_two": {
- "type": "nested",
- "properties": {
- "text": {
- "type": "string",
- "analyzer": "danish"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- # Works as expected
- POST /test_index/file
- {
- "text" : "Text around a name Jensen, Hans and finding the name",
- "level_two_text" : {
- "text" : "Text around a name Jensen, Anders and finding the name"
- },
- "level_three_text" : {
- "level_two" : {
- "text" : "Text around a name Hans Jensen and finding the name"
- }
- }
- }
- # Works as expected
- POST /test_index/file/_search
- {
- "query": {
- "nested": {
- "path": "level_two_text",
- "query": {
- "query_string": {
- "default_field": "level_two_text.text",
- "query": "\"Jensen, Anders\""
- }
- },
- "inner_hits" : {
- "highlight" : {
- "fields" : {
- "level_two_text.text" : {
- "number_of_fragments": 0
- }
- }
- }
- }
- }
- }
- }
- # Does not work as expected - but works if using the english analyzer instead of the danish
- POST /test_index/file/_search
- {
- "query": {
- "nested": {
- "path": "level_three_text.level_two",
- "query": {
- "query_string": {
- "default_field": "level_three_text.level_two.text",
- "query": "\"Hans Jensen\""
- }
- },
- "inner_hits" : {
- "highlight" : {
- "fields" : {
- "level_three_text.level_two.text" : {
- "number_of_fragments": 0
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement