diff --git a/app/Http/Controllers/Frontend/SearchController.php b/app/Http/Controllers/Frontend/SearchController.php index 58655a9..2b45573 100644 --- a/app/Http/Controllers/Frontend/SearchController.php +++ b/app/Http/Controllers/Frontend/SearchController.php @@ -101,6 +101,12 @@ class SearchController extends Controller public function index(): View { $totalNumOfDocs = Dataset::count(); + // get a select query instance + $query = $this->client->createQuery($this->client::QUERY_SELECT); + // this executes the query and returns the result + $resultset = $this->client->execute($query); + // // display the total number of documents found by solr + $totalNumOfDocs = $resultset->getNumFound(); return view('frontend.solrsearch.index', compact('totalNumOfDocs')); } diff --git a/app/Http/Controllers/Frontend/SolariumController.php b/app/Http/Controllers/Frontend/SolariumController.php new file mode 100644 index 0000000..14ef8d7 --- /dev/null +++ b/app/Http/Controllers/Frontend/SolariumController.php @@ -0,0 +1,89 @@ +client = $client; + } + + /** + * Displays simple search form. + */ + public function index(Request $request): View + { + if (Input::has('q')) { + // Create a search query + $query = $this->client->createSelect(); + + // Set the query string + if (Input::get('q') != "") { + $query->setQuery('%P1%', array(Input::get('q'))); + } else { + $query = $this->client->createQuery($this->client::QUERY_SELECT); + } + + // Execute the query and return the result + $resultset = $this->client->select($query); + + // Pass the resultset to the view and return. + return view('frontend.search.index', array( + 'q' => Input::get('q'), + 'resultset' => $resultset, + )); + } + return view('frontend.search.index'); + } + + public function ping() + { + // create a ping query + $ping = $this->client->createPing(); + + // execute the ping query + try { + $this->client->ping($ping); + return response()->json('OK'); + } catch (\Solarium\Exception $e) { + return response()->json('ERROR', 500); + } + } + + public function search() + { + $filter = "test"; //$request->input('query'); + + // get a select query instance + $query = $this->client->createSelect(); + + // $query = $this->client->createSelect(); + $query->setQuery('title:'. $filter); + // set a query (all prices starting from 12) + // $query->setQuery('price:[12 TO *]'); + // set start and rows param (comparable to SQL limit) using fluent interface + //$query->setStart(2)->setRows(20); + + // this executes the query and returns the result + $resultset = $this->client->select($query); + // display the total number of documents found by solr + $response = 'NumFound: ' . $resultset->getNumFound(); + // show documents using the resultset iterator + foreach ($resultset as $document) { + $response = $response . '
'; + $response = $response . ''; + $response = $response . ''; + $response = $response . ''; + $response = $response . '
id' . $document->id . '
title' . $document->title_output . '
abstract' . $document->abstract_output . '
'; + } + echo $response; + } +} diff --git a/app/Providers/SolariumServiceProvider.php b/app/Providers/SolariumServiceProvider.php index 83368ba..fd5701f 100644 --- a/app/Providers/SolariumServiceProvider.php +++ b/app/Providers/SolariumServiceProvider.php @@ -22,10 +22,10 @@ class SolariumServiceProvider extends ServiceProvider $config = array( 'endpoint' => array( 'localhost' => array( - 'host' => '127.0.0.1', + 'host' => 'repository.geologie.ac.at', 'port' => '8983', 'path' => '/solr/', - 'core' => 'opus4' + 'core' => 'rdr_data' ) ) ); diff --git a/config/solarium.php b/config/solarium.php index 5c714ab..bea3fb2 100644 --- a/config/solarium.php +++ b/config/solarium.php @@ -2,7 +2,7 @@ return [ 'endpoint' => [ - 'repository.geologie.ac.at' => [ + 'repository' => [ 'host' => env('SOLR_HOST', 'repository.geologie.ac.at'), 'port' => env('SOLR_PORT', '8983'), 'path' => env('SOLR_PATH', '/solr/'), diff --git a/database/seeds/MimetypeTableSeeder.php b/database/seeds/MimetypeTableSeeder.php index 0eefec7..87d80cb 100644 --- a/database/seeds/MimetypeTableSeeder.php +++ b/database/seeds/MimetypeTableSeeder.php @@ -11,6 +11,13 @@ class MimetypeTableSeeder extends Seeder { DB::table('mime_types')->insert([ + [ + 'name' => 'application/geopackage+sqlite3', + 'file_extension' => 'gpkg', + 'enabled' =>true, + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], [ 'name' => 'image/jpeg', 'file_extension' => 'jpg|jpeg|jpe', diff --git a/public/css/style.css b/public/css/style.css index ed7c86a..9dcfacf 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -407,9 +407,48 @@ section.normal { margin: 0; } + + +.search-items { + list-style: none; + width: 100%; + display: inline-block; +} +.search-items li { + position: relative; + overflow: hidden; + /* important because we need to overwrite the default skeleton */ + margin: 0!important; + /* width: 33%; */ + /* border: 10px solid white; */ + + position: relative; + padding-left: 15px; + padding-right: 15px; +} +.search-items li:nth-child(4n) { + margin-left: 0; +} + + + + + + + + + + + + + + + + + /* Work */ .work { - background-color: #F5F5F5; + /* background-color: #F5F5F5; */ } /* Work Filters */ @@ -503,6 +542,11 @@ section.normal { padding-left: 20px; padding-right: 20px; } +.work-front .icon { + line-height: 1; + font-size: 40px; + color: #00bfffcc; +} .work-items li:hover .work-detail{ opacity: 1; diff --git a/public/images/hero_bg_image.jpg b/public/images/hero_bg_image.jpg deleted file mode 100644 index 93d0c3a..0000000 Binary files a/public/images/hero_bg_image.jpg and /dev/null differ diff --git a/resources/views/frontend/home/index.blade.php b/resources/views/frontend/home/index.blade.php index 3dc94b4..3dc0597 100644 --- a/resources/views/frontend/home/index.blade.php +++ b/resources/views/frontend/home/index.blade.php @@ -8,7 +8,7 @@

Research Data Repository

- Data Publisher for Geo and Atmospheric Science Austria + Data Publisher for Geo- and Atmospheric Science Austria

@@ -53,6 +53,7 @@
+

Data Archival

@@ -69,6 +70,7 @@
+

Data Publication

@@ -86,6 +88,7 @@
+

Peer Review

diff --git a/resources/views/frontend/home/services.blade.php b/resources/views/frontend/home/services.blade.php index 23ea6b1..cb263af 100644 --- a/resources/views/frontend/home/services.blade.php +++ b/resources/views/frontend/home/services.blade.php @@ -19,11 +19,12 @@
+

Data Archival

-
+

Data Archival

RDR provides format-independent archiving services for data protection. @@ -35,6 +36,7 @@

+

Data Publication

@@ -50,8 +52,9 @@
  • -
    +
    +

    Peer Review

    diff --git a/resources/views/frontend/search/index.blade.php b/resources/views/frontend/search/index.blade.php new file mode 100644 index 0000000..d22d889 --- /dev/null +++ b/resources/views/frontend/search/index.blade.php @@ -0,0 +1,109 @@ +@extends('layouts.app') + +@section('title', Lang::get('resources.solrsearch_title_simple')) + +@section('content') + + + +@endsection + + + \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 4b2776a..7cbcd6d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -469,16 +469,21 @@ Route::group(['namespace' => 'Frontend', 'as' => 'frontend.'], function () { Route::get('pages/{slug}', 'HomeController@showPage')->name('pages.show'); //=================================================solr search==================================================== - Route::get('/index', [ - 'as' => 'search.index', 'uses' => 'SearchController@index', - ]); + // Route::get('/index', [ + // 'as' => 'search.index', 'uses' => 'SearchController@index', + // ]); Route::post('/queries', [ 'as' => 'queries', 'uses' => 'SearchController@search', ]); Route::get('/queries/', [ 'as' => 'queries1', 'uses' => 'SearchController@search', ]); - Route::get('/ping', 'SearchController@ping'); + // Route::get('/ping', 'SearchController@ping'); + Route::get('/ping', 'SolariumController@ping'); + // Route::get('/search', 'SolariumController@search'); + Route::get('/search', [ + 'as' => 'search.index', 'uses' => 'SolariumController@index', + ]); }); //=================================================borrow====================================================