Last active
September 23, 2015 13:32
-
-
Save edwardsmit/2ec8506db2e4402024dd to your computer and use it in GitHub Desktop.
Elasticsearch: no_match_size not obeyed using the fvh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
curl -XDELETE 'localhost:9200/highlightproblem'; echo | |
curl -XPUT 'localhost:9200/highlightproblem'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/_mapping' -d '{ | |
"highlightproblem": { | |
"properties": { | |
"title": { | |
"type": "string", | |
"term_vector": "with_positions_offsets" | |
}, | |
"body": { | |
"type": "string", | |
"term_vector": "with_positions_offsets" | |
} | |
} | |
} | |
}'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/1' -d '{ | |
"title": "Highlight title", | |
"body": "Highlight singular body" | |
}'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/2' -d '{ | |
"title": "Highlight title", | |
"body": ["array body", "array body 2"] | |
}'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/3' -d '{ | |
"title": "Highlight title", | |
"body": "Singular body" | |
}'; echo | |
curl -XPUT 'localhost:9200/highlightproblem/highlightproblem/4' -d '{ | |
"title": "Highlight title", | |
"body": ["highlight array body", "array body 2"] | |
}'; echo | |
curl -XPOST 'http://localhost:9200/highlightproblem/_refresh'; echo | |
curl -XPOST 'http://localhost:9200/highlightproblem/_search?pretty' -d '{ | |
"query": { | |
"match": { | |
"_all": "highlight" | |
} | |
}, | |
"highlight": { | |
"fields": { | |
"body": { | |
"fragment_size": 100, | |
"number_of_fragments": 2, | |
"no_match_size": 100 | |
} | |
} | |
} | |
}' | |
echo "Observe the missing highlight-field containing the no_match contents for #id 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated based on feedback in elastic/elasticsearch#13734