solraium faceted search

This commit is contained in:
Arno Kaimbacher 2019-09-25 18:51:36 +02:00
parent 024002eded
commit 9855c235b7
3 changed files with 289 additions and 71 deletions

View file

@ -11,75 +11,141 @@
<h3 class="separator">SEARCH</h3>
</div>
</div>
<div class="row">
<!-- SEARCH RESULTS GO HERE, EXACTLY AS BEFORE -->
<div class="content">
<div class="sidebar-simplesearch">
{{ Form::open(array('method' => 'GET')) }}
<div class="twelve columns">
<div class="content">
<div class="sidebar-simplesearch">
{{ Form::open(array('method' => 'GET')) }}
{!! Form::text('q', Input::get('q'), array('class'=>'u-full-width',
'placeholder'=>'Enter your search term')) !!}
<span class="input-group-btn">
{{-- {{ Form::submit('Search', array('class' => 'btn btn-primary btn-lg')) }} --}}
<button type="submit">
<i class="fa fa-search"></i>
</button>
</span>
{!! Form::text('q', Input::get('q'), array('class'=>'u-full-width',
'placeholder'=>'Enter your search term')) !!}
<span class="input-group-btn">
{{-- {{ Form::submit('Search', array('class' => 'btn btn-primary btn-lg')) }} --}}
<button type="submit">
<i class="fa fa-search"></i>
</button>
</span>
{{ Form::close() }}
</div>
</div>
{{ Form::close() }}
</div>
</div>
@if (isset($resultset))
<header>
<p>Your search yielded <strong>{{ $resultset->getNumFound() }}</strong> results:</p>
<hr />
</header>
<div class="row">
<ul class="search-items isotope js-isotope u-cf">
@foreach ($resultset as $document)
<div class="four columns">
<div id="left-bar">
<h3 class="indexheader">Refine by</h3>
<?php $facet = $resultset->getFacetSet()->getFacet('language'); ?>
<div class="panel panel-primary">
<li>
<div class="post">
<header class="post-header">
<h3 class="post-title">
<a href="{{ URL::route('frontend.dataset.show',['id' =>$document->id]) }}">
{{ $document->title_output }}
</a>
</h3>
</header>
<div class="blog-meta">
{{ date('D, m M, Y', $document->server_date_modified) }}
</div>
{{-- <h3 class="panel-title">Language</h3> --}}
<h3 class="filterViewModelName">Language</h3>
<div class="post-description">
@if (is_array($document->author))
<em>Author: {{ implode(', ', $document->author) }}</em>
<ul class="filterItems">
@foreach ($facet as $value => $count)
@if ($count)
<li class="list-group-item">
<a class="firstLabel"
href="?{{ http_build_query(array_merge(Input::all(), array('language' => $value))) }}">{{ $value }}</a>
<span class="badge">{{ $count }}</span>
</li>
@endif
<p>
<em>Abstract: {{ $document->abstract_output }}</em>
</p>
</div>
@endforeach
</ul>
</div>
</li>
@endforeach
</ul>
<?php $facet = $resultset->getFacetSet()->getFacet('datatype'); ?>
<div class="panel panel-primary">
{{-- <h3 class="panel-title">Datatype</h3> --}}
<h3 class="filterViewModelName">Data Type</h3>
<ul class="filterItems">
@foreach ($facet as $value => $count)
@if ($count)
<li class="list-group-item">
<a class="firstLabel"
href="?{{ http_build_query(array_merge(Input::all(), array('datatype' => $value))) }}">{{ $value }}</a>
<span class="badge">{{ $count }}</span>
</li>
@endif
@endforeach
</ul>
</div>
<?php $facet = $resultset->getFacetSet()->getFacet('year'); ?>
<div class="panel panel-primary">
<h3 class="filterViewModelName">Year</h3>
<ul class="filterItems">
@foreach ($facet as $value => $count)
@if ($count)
<li class="list-group-item">
<a class="firstLabel"
href="?{{ http_build_query(array_merge(Input::all(), array('year' => $value))) }}">{{ $value }}</a>
<span class="badge">{{ $count }}</span>
</li>
@endif
@endforeach
</ul>
</div>
</div>
</div>
<div class="eight columns">
@if (isset($resultset))
<header>
<p>Your search yielded <strong>{{ $resultset->getNumFound() }}</strong> results:</p>
<hr />
</header>
<section class="results normal">
<ul class="search-items isotope js-isotope u-cf">
@foreach ($resultset as $document)
<li>
<div class="post">
<header class="post-header">
<h3 class="post-title">
<a href="{{ URL::route('frontend.dataset.show',['id' =>$document->id]) }}">
{{ $document->title_output }}
</a>
</h3>
</header>
<div class="blog-meta">
{{ date('D, m M, Y', $document->server_date_modified) }}
</div>
@if (isset($document->title_additional) && is_array($document->title_additional))
<div class="blog-meta">
<em>Additional Title: {{ implode('; ', $document->title_additional) }}</em>
</div>
@endif
<div class="post-description">
@if (is_array($document->author))
<em>Author: {{ implode('; ', $document->author) }}</em>
@endif
<p>
<em>Abstract: {{ $document->abstract_output }}</em>
</p>
<p>
<em>Creating Corporation: {{ $document->creating_corporation }}</em>
</p>
</div>
</div>
</li>
@endforeach
</ul>
</section>
@endif
</div>
</div>
@endif
</div>
</section>
@ -89,6 +155,132 @@
@section('head')
<style>
*-------------------------------------------------- */
/* lists in the left bar */
/*-------------------------------------------------- */
.overflowing {
color: #444444;
list-style: none;
}
.overflowing span {
color: #444444;
font-style: italic;
text-decoration: underline;
cursor: pointer;
}
ul.filterItems li {
min-height: 15px;
color: #444;
font-size: 12px;
list-style-type: disc;
/*list-style-position:inside;*/
/*
* We want the bullets outside of the list,
* so the text is aligned. Now the actual bullet
* is outside of the lists container
*/
list-style-position: outside;
/*
* Because the bullet is outside of the lists
* container, indent the list entirely
*/
margin-left: 1em;
}
.filterItems.limited li:nth-of-type(1n+6) {
display: none;
}
ul.filterItems .active {
background-color: lightgray;
}
/*ul.filterItems li.hover{
background-color: yellow;
}*/
/*ul.filterItems li.hover .firstLabel,
ul.filterItems li.hover a{
color: #0099cc;
cursor:pointer;
}*/
/*ul.filterItems span.hover {
color: #0099cc;
cursor:pointer;
}*/
ul.filterItems li a:hover {
color: #0099cc;
cursor: pointer;
}
/* Relativer Tooltip */
.tooltip {
position: relative;
text-decoration: none;
font-weight: bolder;
color: #444444;
cursor: pointer;
overflow: visible;
font-size: 8px;
}
.sidebar.left {
background-color: rgb(244, 244, 244);
float: left;
border-left: none;
width: 250px;
height: 100%;
overflow-y: auto;
}
/* #left-bar {
position:absolute;
height:auto;
width:auto;
bottom:0;
top:0;
left:0;
right:0;
margin: 15px;
} */
.sidebar.right {
border: none;
margin-left: 250px;
background-color: white;
}
#left-bar .indexheader {
color: #a9a9a9;
font-weight: bold;
display: block;
}
#left-bar .filterViewModelName {
color: black;
margin-top: 10px;
margin-bottom: 2px;
/* font-size: 12px; */
display: block;
font-weight: bold;
}
.sidebar-simplesearch {
position: relative;
margin-bottom: 2.5em;
@ -110,5 +302,4 @@
}
</style>
@endsection
@endsection