Skip to content

Commit

Permalink
Add new fulltextsearch ? query to check whether the fulltext search…
Browse files Browse the repository at this point in the history
… was available or not.
  • Loading branch information
mherger committed Jul 2, 2021
1 parent 78176cb commit 100d43c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
30 changes: 30 additions & 0 deletions HTML/EN/html/docs/cli-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ <h2 id="Introduction">Introduction</h2>

<h3 id="Changelog">Changelog</h3>

<h4 id="8.2">Changes starting from Squeezebox Server 8.2</h4>
<ul>
<li>Added query to figure out whether fulltext search is enabled or not (<a href="#fulltextsearch">fulltextsearch</a>).</li>
</ul>

<h4 id="8.0">Changes starting from Squeezebox Server 8.0</h4>
<ul>
<li>Added support for external IDs: when libraries from online music services are imported, <a href="#artists">artists</a>, <a href="#albums">albums</a>, and <a href="#titles">titles</a>
Expand Down Expand Up @@ -8762,6 +8767,9 @@ <h3 id="PG">
<li>
<strong><code><a href="#radios">apps</a></code></strong>
</li>
<li>
<strong><code><a href="#fulltextsearch">fulltextsearch</a></code></strong>
</li>
<li>
<strong><a href="#XMLBrowser">Live Music Archive, MP3tunes, Pandora, Podcasts, RadioTime, Napster, Shoutcast, Staff Picks, RSS</a></strong>
</li>
Expand Down Expand Up @@ -8909,6 +8917,28 @@ <h3 id="PG">
</blockquote>


<br>
<p id="fulltextsearch">
<strong>
<code>
fulltextsearch ?
</code>
</strong>
</p>
<p>
The &quot;fulltextsearch&quot; query returns a flag to tell whether the fulltext search is available.
</p>
<p>
Example:
</p>
<blockquote>
<p>
Request: &quot;fulltextsearch ?&lt;LF&gt;&quot;
<br>
Response: &quot;fulltextsearch 1&lt;LF&gt;&quot;
</p>
</blockquote>

<br>
<h3 id="XMLBrowser">
Live Music Archive, MP3tunes, Pandora, Podcasts, RadioTime, Napster, Shoutcast, Staff Picks, RSS
Expand Down
5 changes: 5 additions & 0 deletions Slim/Plugin/FullTextSearch/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ sub initPlugin {
Slim::Utils::Timers::setTimer( $_[1], time() + 1, \&checkPlaylist, $_[0] );
}, want_object => 1 } );

# allow external callers to figure out whether FTS is enabled or not
Slim::Control::Request::addDispatch(['fulltextsearch', '?'], [0, 1, 0, sub {
$_[0]->addResult('_can', Slim::Schema->canFulltextSearch ? 1 : 0);
}]);

# don't continue if the library hasn't been initialized yet, or if a schema change is going to trigger a rescan anyway
return unless Slim::Schema->hasLibrary() && !Slim::Schema->schemaUpdated;

Expand Down

0 comments on commit 100d43c

Please sign in to comment.