In use with Sulu v2.3.3, i tried to add an additional, non-searchable field to an index by listening to the PreIndexEvent and adding the field manually using Massive\Bundle\SearchBundle\Search\Factory\Factory like so:
Although the $indexed-param of $factory::createField() is set to false, the additionally created field is still searchable within the index.
According to feedback on this topic in the Sulu Slack Channel, the root of the problem is to be found in ElasticSearchAdapter::prepareSearch(SearchQuery $searchQuery), as the query_string-array should contain an additional fields array containing the names of all fields where $indexed is true.
In use with Sulu v2.3.3, i tried to add an additional, non-searchable field to an index by listening to the PreIndexEvent and adding the field manually using
Massive\Bundle\SearchBundle\Search\Factory\Factory
like so:Although the
$indexed
-param of$factory::createField()
is set tofalse
, the additionally created field is still searchable within the index.According to feedback on this topic in the Sulu Slack Channel, the root of the problem is to be found in ElasticSearchAdapter::prepareSearch(SearchQuery $searchQuery), as the
query_string
-array should contain an additional fields array containing the names of all fields where$indexed
istrue
.