Skip to content

Commit

Permalink
Merge pull request #2 from peviitor-ro/live
Browse files Browse the repository at this point in the history
Live
  • Loading branch information
sebiboga committed Oct 29, 2021
2 parents 627910f + a787476 commit d3fedcd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 38 deletions.
8 changes: 6 additions & 2 deletions _config/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
$server = 'http://23.97.216.44/solr/';
//$server = 'http://zimbor.go.ro/solr/';
?>

if ($_SERVER["SERVER_NAME"]=='localhost') {
$server = 'http://localhost:8983/solr/';
}

?>
8 changes: 0 additions & 8 deletions v0/search/error_log

This file was deleted.

40 changes: 14 additions & 26 deletions v0/search/index.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
<?php

header("Access-Control-Allow-Origin: *");

$qs = $_SERVER['QUERY_STRING'];

// $url = 'http://solr.peviitor.ro/solr/shaqodoon/select?'.$qs;

$url = 'http://23.97.216.44/solr/shaqodoon/select?'.$qs;





$json = file_get_contents($url);





header("Access-Control-Allow-Origin: *");
$qs = $_SERVER['QUERY_STRING'];


function get_server(){
//get the IP of the server
//we need a config file to know where is the SOLR
require('../../_config/index.php');
return $server;
}

$server = get_server();
$url = $server.'shaqodoon/select?'.$qs;
$json = file_get_contents($url);
echo $json;







?>
14 changes: 12 additions & 2 deletions v1/random/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@
* )
*/

function get_server(){
//get the IP of the server
//we need a config file to know where is the SOLR
require('../../_config/index.php');
return $server;
}


$server = get_server();

$max=10800;
$start = rand(0,$max);
$qs = 'q=*%3A*&rows=1&start='.$start.'&omitHeader=true';
// $url = 'http://solr.peviitor.ro/solr/shaqodoon/select?'.$qs;
$url = 'http://23.97.216.44/solr/shaqodoon/select?'.$qs;

$url = $server.'shaqodoon/select?'.$qs;


$json = file_get_contents($url);
Expand Down

0 comments on commit d3fedcd

Please sign in to comment.