Skip to content
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

add Nextcloud 20 unified searching #344

Closed
wants to merge 2 commits into from
Closed

add Nextcloud 20 unified searching #344

wants to merge 2 commits into from

Conversation

dassio
Copy link
Contributor

@dassio dassio commented Oct 9, 2020

nextcloud change the search mechanism , using an unified search . app has to provide an class that implements IProvider interface

Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dassio
Thank you very much for the contribution.

Most of the comments are due bad styles.. but first I would recommend that you try to divide the PR in two.

One PR to support NC20.

Another PR for unified search.

  • I think it is a good feature of NC20, but I think it is not intended to return all photos of a person.
  • It should return the persons that you found, and if you click them, show the photos.
  • For this feature, you may want to wait that i finish the person view on PR Bye bye 'New person..' #336

lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/AppInfo/Application.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
@matiasdelellis
Copy link
Owner

Hi @dassio
There are comments that I received in the mail, but not here.

not really, you can see all the persons at the personal setting page, the unified search is to display the photos belonging to that person

No. The unified search, which allows is to unify the search framework among all the applications!. 😅
When you search within Files, Photos, Deck, Notes, or even within the Settings, all providers are consulted. So these queries should be fast, and since the results of all applications are displayed, they should show only the relevant information.

Can you imagine that happend if you rename your files to mom_***. Jpg, and files return 5000 files and facerecognition shows you another 5000?. It is completely insane. 🙈 😅

That said, I insist on only showing a link to the person within our application. 😬
This view doesn't exist yet (Depend on #336), but just opening our application is more than enough.

i don't see a way to dispaly certain photos after one click: nextcloud does not have this feature to filter photos . and it wil really difficult to change the behaviour of the unified search client js (probably server guys will not accept any PR specific to one app)

Example..
nextcloud/deck@2059e55

@dassio
Copy link
Contributor Author

dassio commented Oct 10, 2020

Hi @matiasdelellis
sorry for the confusion, before i did not check the PR you mentioned , then i saw it, that's why i delete the comment

yes, it would be better to have a link to the personal setting page, i will update on that

@matiasdelellis matiasdelellis mentioned this pull request Oct 12, 2020
4 tasks
Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow.. Much better .. Thanks again. 😄

Tomorrow I'll merge #336 and you should rebase on it to reuse a lot of code.

Sorry if I'm annoying.. 🙈 😅

lib/AppInfo/Application.php Show resolved Hide resolved
lib/AppInfo/Application20.php Outdated Show resolved Hide resolved
lib/Db/ImageMapper.php Outdated Show resolved Hide resolved
lib/Db/PersonMapper.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
lib/Search/PersonSearchProvider.php Outdated Show resolved Hide resolved
@matiasdelellis
Copy link
Owner

@dassio
Just merge #336 . Please, rebase on master, and see last comments.

Signed-off-by: xiangbin.li <dassio@icloud.com>
Signed-off-by: xiangbin.li <dassio@icloud.com>
Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dassio

Great!!!. 😄 😃 😬 😁 😀 🎉

Last change that I will ask you, and after testing we can merge it. 😀

array_map(function (Person $result) {
$personName = $result->getName();
return new SearchResultEntry(
$this->urlGenerator->imagePath('facerecognition','avatar.webp'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->urlGenerator->imagePath('facerecognition','avatar.webp'),
''

Don't add a new icon, just use the application icon at least in this stage..

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.s: The main reason is that bitmap icons don't adapt on dark themes. 😅

$personName,
'',
$this->urlService->getRedirectToPersonUrl($personName),
'',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'',
'icon-facerecognition',

Acording:
https://github.com/nextcloud/server/blob/3ffd09d3f191def63ad2766368aaef62b333fcd1/lib/public/Search/SearchResultEntry.php#L86-L107

This parameter is the class of the icon... 😉

MM.. You must include the icon as:

.icon-back {
@include icon-color('back', 'facerecognition', $color-black);
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 .icon-facrecognition { 
 	@include icon-color('app-dark', 'facerecognition', $color-black); 
 } 

@@ -120,12 +120,12 @@ public function getRedirectToFileUrl(int $fileId) {
/**
* Redirects to the facerecognition page to show photos of an person.
*
* @param int $personId person id to show
* @param string $personName person id to show
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.. 😬

@matiasdelellis
Copy link
Owner

Ok.. I'm already testing NC19, and it still seems to work fine .. 😄

@matiasdelellis
Copy link
Owner

Hi @dassio
Please, see #343 (comment) and the comments that follow

@benjaminaigner
Copy link

@matiasdelellis @dassio

Dear all, I'm really glad you worked out the unified search!
Is there progress in merging or do you need help in any way for this PR?
Or do you recommend just to check out this PR, apply your change requests and run it?

@matiasdelellis
Copy link
Owner

Hi @dassio

I take your work and I'm about to publish it. 😬

https://services.delellis.com.ar/data/facerecognition/facerecognition.tar.gz

Please, test. just replace them in the apps/facerecognition folder with this.

Thanks for all again. 😄

@matiasdelellis
Copy link
Owner

Merged in last release.. Thanks again.. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants