what this does is extract the tf-idf score for gettysburgfrom the hash value it maps to for every documentand stores that in this hfuuztcvsh fmfwbodf rdd we then combine that with the epdvnfou/bnft so we can see the results[jqqfe ftvmut hfuuztcvsh fmfwbodf[jq epdvnfou/bnft finallywe can print out the answerqsjou #ftuepdvnfougps(fuuztcvshjt qsjou [jqqfe ftvmutnby running the algorithm solet' go run that and see what happens as usualto run the spark scriptwe're not going to just hit the play icon we have to go to tools>canopy command prompt in the command prompt that opens upwe will type in tqbsltvcnju '*%'qzand off it goes we are asking it to chunk through quite bit of dataeven though it' small sample of wikipedia it' still fair chunk of informationso it might take while let' see what comes back for the best document match for gettysburgwhat document has the highest tf-idf scoreit' abraham lincolnisn' that awesomewe just made an actual search engine that actually worksin just few lines of code and there you have itan actual working search algorithm for little piece of wikipedia using spark in mllib and tf-idf and the beauty is we can actually scale that up to all of wikipedia if we wanted toif we had cluster large enough to run it hopefully we got your interest up there in sparkand you can see how it can be applied to solve what can be pretty complicated machine learning problems in distributed manner soit' very important tooland want to make sure you don' get through this book on data science without at least knowing the concepts of how spark can be applied to big data problems sowhen you need to move beyond what one computer can dorememberspark is at your disposal