-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-31299: Added language mask to LSE search index #2940
Conversation
eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchHitAdapter.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Pagination/Pagerfanta/ContentSearchHitAdapter.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.php
Outdated
Show resolved
Hide resolved
…Handler/FullText.php Co-Authored-By: André R. <[email protected]>
eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Search/Legacy/Content/Mapper/FullTextMapper.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michal-myszka I've missed one more thing (seems the scripts for the previous release miss the same thing, but out of scope here):
Co-Authored-By: Andrew Longosz <[email protected]>
Co-Authored-By: Andrew Longosz <[email protected]>
usort( | ||
$searchHits, | ||
function ($a, $b) { | ||
return ($a->valueObject->id < $b->valueObject->id) ? -1 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the spaceship operator here. This opportunity may not happen again 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used (hurray!) :)
@@ -136,6 +143,8 @@ public function index(FullTextData $fullTextData) | |||
'ContentClassAttributeID' => $fullTextValue->fieldDefinitionId, | |||
'identifier' => $fullTextValue->fieldDefinitionIdentifier, | |||
'integer_value' => $integerValue, | |||
'language_code' => $fullTextValue->languageCode, | |||
'is_main_and_always_available' => $fullTextValue->isMainAndAlwaysAvailable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language_code
/ is_main_and_always_available
values needs to added to
ezpublish-kernel/eZ/Publish/Core/Search/Legacy/Content/WordIndexer/Gateway/DoctrineDatabase.php
Lines 155 to 158 in 4d46223
$indexArray[] = ['Word' => $additionalUrlWord, | |
'ContentClassAttributeID' => $fullTextValue->fieldDefinitionId, | |
'identifier' => $fullTextValue->fieldDefinitionIdentifier, | |
'integer_value' => $integerValue, ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, added
Co-Authored-By: Adam Wójs <[email protected]>
Co-Authored-By: Adam Wójs <[email protected]>
bool $useAlwaysAvailable | ||
): SearchResult { | ||
if (false === in_array($findMethod, self::AVAILABLE_FIND_METHODS, true)) { | ||
throw new \InvalidArgumentException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: missing import and @throws
docblock
@@ -17,12 +17,13 @@ class ContentSearchAdapterTest extends ContentSearchHitAdapterTest | |||
/** | |||
* @param Query $query | |||
* @param SearchService $searchService | |||
* @param array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param array | |
* @param array $languageFilter |
@@ -37,9 +37,9 @@ protected function setUp() | |||
* | |||
* @return ContentSearchHitAdapter | |||
*/ | |||
protected function getAdapter(Query $query, SearchService $searchService) | |||
protected function getAdapter(Query $query, SearchService $searchService, array $languageFilter = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: missing @param
for $languageFilter
@@ -65,7 +77,7 @@ public function getSlice($offset, $length) | |||
$query->limit = $length; | |||
$query->performCount = false; | |||
|
|||
$searchResult = $this->searchService->findContent($query); | |||
$searchResult = $this->searchService->findContent($query, $this->languageFilter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but it seems that we are missing an assertion ensuring that language Filter
is passed to findContent
ContentSearchHitAdapterTest.
|
||
$setupFactory = $this->getSetupFactory(); | ||
|
||
if ($setupFactory instanceof LegacySolrSetupFactory) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this block would look better in a separate data provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine from my POV 😉
Could you merge it up? |
7.5
This PR's changes improvement searching in languages (in translations).
Related changes in
ezsystems/ezplatform-admin-ui#1223
ezsystems/ezplatform-solr-search-engine#168
TODO:
$ composer fix-cs
).