Last active
September 30, 2020 11:09
-
-
Save jamieparkinson/7365939512e54128739b0ed8d33cf90d to your computer and use it in GitHub Desktop.
TF-IDF per-field document frequency proof
This file contains 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
PUT tf-idf-test | |
PUT tf-idf-test/_mapping | |
{ | |
"properties": { | |
"thing": { | |
"type": "text" | |
}, | |
"secret": { | |
"type": "text" | |
} | |
} | |
} | |
PUT tf-idf-test/_bulk | |
{"index":{"_id": "1"}} | |
{"thing":"Bananas apples lemons oranges cabbages courgettes","secret":"apples apples apples apples apples"} | |
{"index":{"_id": "2"}} | |
{"thing":"Bananas lemons oranges courgettes","secret":"apples apples apples apples apples"} | |
{"index":{"_id": "3"}} | |
{"thing":"Bananas lemons oranges cabbages courgettes","secret":"apples apples apples apples apples"} | |
{"index":{"_id": "4"}} | |
{"thing":"Apples lemons oranges cabbages courgettes","secret":"apples apples apples apples apples"} | |
{"index":{"_id": "5"}} | |
{"thing":"Bananas oranges cabbages courgettes","secret":"carrots carrots carrots carrots carrots"} | |
GET tf-idf-test/_explain/1 | |
{ | |
"query": { | |
"term": { | |
"thing": "apples" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment