Created
May 3, 2013 02:19
-
-
Save heukirne/5506796 to your computer and use it in GitHub Desktop.
Course of Information Retrieval
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
<?php | |
$topicoStr = file_get_contents("Topicos.txt"); | |
preg_match_all("/title\>([^\<]+)</", $topicoStr, $topicos); | |
$contRow = 0; | |
foreach ($topicos[1] as $topic) { | |
if (strlen(trim($topic))>0) { | |
$contRow++; $contDoc=0; | |
$code = file_get_contents("http://localhost:8983/solr/collection1/select?rows=100&fl=id,score&wt=php&rows=1&q=".urlencode(trim($topic))); | |
eval("\$result = " . $code . ";"); | |
foreach ($result['response']['docs'] as $line) { | |
echo "$contRow\tQ0\t{$line['id']}\t$contDoc\t{$line['score']}\thenrique_manuela\n"; | |
$contDoc++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment