Merge branch 'master' into PHRAS-2950_Prod_facets_tooltips

This commit is contained in:
Nicolas Maillat
2020-02-27 10:50:45 +01:00
committed by GitHub
2 changed files with 11 additions and 7 deletions

View File

@@ -1573,9 +1573,9 @@ class V1Controller extends Controller
$options->setFirstResult((int)($request->get('offset_start') ?: 0)); $options->setFirstResult((int)($request->get('offset_start') ?: 0));
$options->setMaxResults((int)$request->get('per_page') ?: 10); $options->setMaxResults((int)$request->get('per_page') ?: 10);
$this->getSearchEngine()->resetCache(); $searchEngine = $this->getSearchEngine();
$search_result = $this->getSearchEngine()->query((string)$request->get('query'), $options); $search_result = $searchEngine->query((string)$request->get('query'), $options);
$this->getUserManipulator()->logQuery($this->getAuthenticatedUser(), $search_result->getQueryText()); $this->getUserManipulator()->logQuery($this->getAuthenticatedUser(), $search_result->getQueryText());
@@ -1583,12 +1583,12 @@ class V1Controller extends Controller
$collectionsReferencesByDatabox = $options->getCollectionsReferencesByDatabox(); $collectionsReferencesByDatabox = $options->getCollectionsReferencesByDatabox();
foreach ($collectionsReferencesByDatabox as $sbid => $references) { foreach ($collectionsReferencesByDatabox as $sbid => $references) {
$databox = $this->findDataboxById($sbid); $databox = $this->findDataboxById($sbid);
$collectionsIds = array_map(function(CollectionReference $ref){return $ref->getCollectionId();}, $references); $collectionsIds = array_map(function (CollectionReference $ref) {
return $ref->getCollectionId();
}, $references);
$this->getSearchEngineLogger()->log($databox, $search_result->getQueryText(), $search_result->getTotal(), $collectionsIds); $this->getSearchEngineLogger()->log($databox, $search_result->getQueryText(), $search_result->getTotal(), $collectionsIds);
} }
$this->getSearchEngine()->clearCache();
return $search_result; return $search_result;
} }

View File

@@ -84,10 +84,14 @@ class DatabaseMetaProvider implements ServiceProviderInterface
$service = $app['phraseanet.cache-service']; $service = $app['phraseanet.cache-service'];
$config->setMetadataCacheImpl( $config->setMetadataCacheImpl(
$service->factory('ORM_metadata', $app['orm.cache.driver'], $app['orm.cache.options']) $app['orm.cache.factory.filesystem'](array(
'path' => $app['cache.path'].'/doctrine/metadata',
))
); );
$config->setQueryCacheImpl( $config->setQueryCacheImpl(
$service->factory('ORM_query', $app['orm.cache.driver'], $app['orm.cache.options']) $app['orm.cache.factory.filesystem'](array(
'path' => $app['cache.path'].'/doctrine/query',
))
); );
$config->setResultCacheImpl( $config->setResultCacheImpl(
$service->factory('ORM_result', $app['orm.cache.driver'], $app['orm.cache.options']) $service->factory('ORM_result', $app['orm.cache.driver'], $app['orm.cache.options'])