mirror of
https://codeberg.org/SeedDMS/paperless
synced 2025-02-06 06:55:28 +00:00
field for autocompletion can be set
This commit is contained in:
parent
9f0df3cabe
commit
321f80f974
|
@ -554,6 +554,10 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
$fulltextservice = $this->container->fulltextservice;
|
||||
$logger = $this->container->logger;
|
||||
|
||||
if(!empty($settings->_extensions['paperless']['autocompletefield']))
|
||||
$field = $settings->_extensions['paperless']['autocompletefield'];
|
||||
else
|
||||
$field = 'title';
|
||||
$params = $request->getQueryParams();
|
||||
$query = $params['term'];
|
||||
$logger->log(var_export($params, true), PEAR_LOG_DEBUG);
|
||||
|
@ -561,7 +565,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
|||
$list = [];
|
||||
$index = $fulltextservice->Indexer();
|
||||
if($index) {
|
||||
if($terms = $index->terms($query, 'title')) {
|
||||
if($terms = $index->terms($query, $field)) {
|
||||
foreach($terms as $term)
|
||||
$list[] = $term->text;
|
||||
}
|
||||
|
|
8
conf.php
8
conf.php
|
@ -42,6 +42,14 @@ $EXT_CONF['paperless'] = array(
|
|||
'internal'=>'categories',
|
||||
'allow_empty'=>true,
|
||||
),
|
||||
'autocompletefield' => array(
|
||||
'title'=>'Field used for autocompletion',
|
||||
'help'=>'The terms in this field will be used when the autocomplete method is called.',
|
||||
'type'=>'select',
|
||||
'multiple'=>false,
|
||||
'options'=>['title'=>'Title', 'content'=>'Content'],
|
||||
'allow_empty'=>true,
|
||||
),
|
||||
),
|
||||
'constraints' => array(
|
||||
'depends' => array('php' => '7.4.0-', 'seeddms' => array('5.1.29-5.1.99', '6.0.22-6.0.99')),
|
||||
|
|
Loading…
Reference in New Issue
Block a user