Skip to content

introduce inApps[] filter for search via ajax query - #12555

Merged
butonic merged 1 commit into
masterfrom
app_specific_search
Dec 15, 2014
Merged

butonic merged 1 commit into
masterfrom
app_specific_search

Conversation

@butonic

@butonic butonic commented Dec 2, 2014

Copy link
Copy Markdown
Contributor

Make file results show up in files app only, allows limiting search results to specific apps. see #821

Gracefully handles old apps that don't set the apps option for a search provider.

@PVince81 do we have a JS api to get the currently active app? I currently use var classList = document.getElementById('content').className.split(/\s+/); and grab the first class starting with 'app-' ... but that seems hackish to me.

PRs for contacts, calendar and other apps to follow, as well as a PR to move results to the content area instead of the current tiny dropdown overlay.

@PVince81

PVince81 commented Dec 2, 2014

Copy link
Copy Markdown
Contributor

@butonic raised ticket to add a proper JS API: #12557

@butonic

butonic commented Dec 2, 2014

Copy link
Copy Markdown
Contributor Author

cc @jancborchardt @MTRichards

Comment thread lib/public/search/provider.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

string|null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm, mixed actually

@ghost

ghost commented Dec 2, 2014

Copy link
Copy Markdown

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3643/
🚀 Test PASSed. 🚀

@DeepDiver1975

Copy link
Copy Markdown
Contributor

squasch? 🙈 👍

@butonic
butonic force-pushed the app_specific_search branch from 029318e to e52bf24 Compare December 3, 2014 13:54
@butonic

butonic commented Dec 3, 2014

Copy link
Copy Markdown
Contributor Author

another review? @andrewsbrown maybe?

@abrown

abrown commented Dec 3, 2014

Copy link
Copy Markdown
Contributor

I like it, 👍 . Side note: What's the rationale for lines 46 and 47 in lib/private/search.php? It looks like backwards compatibility but could you confirm and maybe document? The difference between forApps and inApps wasn't readily apparent...

@ghost

ghost commented Dec 3, 2014

Copy link
Copy Markdown

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/3679/
🚀 Test PASSed. 🚀

…s show up in files app only

use more flexible return type

check array with !empty instead of count
@butonic
butonic force-pushed the app_specific_search branch from e52bf24 to 1d490b5 Compare December 10, 2014 14:52
@butonic

butonic commented Dec 10, 2014

Copy link
Copy Markdown
Contributor Author

@andrewsbrown I moved the code to a documented function in the abstract search provider.
@schiesbn @PVince81 another review?

@ghost

ghost commented Dec 10, 2014

Copy link
Copy Markdown

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/4230/
🚀 Test PASSed. 🚀

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 7 new issues, 2 updated code elements

@butonic butonic mentioned this pull request Dec 11, 2014
3 of 4 tasks
@butonic butonic changed the title introduce inApps[] filter for search via ajax query [WIP] introduce inApps[] filter for search via ajax query Dec 11, 2014
@butonic

butonic commented Dec 11, 2014

Copy link
Copy Markdown
Contributor Author

@butonic butonic self-assigned this Dec 15, 2014
@butonic

butonic commented Dec 15, 2014

Copy link
Copy Markdown
Contributor Author

Ok, instead of changing everything at once let us merge this. We can move the relevant code to the search app if it makes sense after we decided how to handle search/filter/find. I fear that discussion might take a while so I prefer to get app specific search ready asap. @PVince81 @schiesbn can I get another 👍 ?

@butonic butonic changed the title [WIP] introduce inApps[] filter for search via ajax query introduce inApps[] filter for search via ajax query Dec 15, 2014
Comment thread lib/private/search.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a unit test that needs updating for this ?

@PVince81

Copy link
Copy Markdown
Contributor

I'm getting Class 'OC\Search\Provider' not found in /srv/www/htdocs/owncloud/apps3/calendar/lib/search/provider.php because I haven't checked out the branch yet.
At some point we might want to add a try/catch if a provider isn't available, at least we could still display results for the others. Ignoring for now.

@PVince81

Copy link
Copy Markdown
Contributor

Hmmm... this happened while having inApps[]=files in the URL. Which means that even though we only search in the files provider, we still load the other providers ?

@butonic

butonic commented Dec 15, 2014

Copy link
Copy Markdown
Contributor Author

The search providers are registered by the apps themselves. For backwards compatibility I only query selected providers when both a) the provider has been registered for a specific type and b) the query was for a specific type. Otherwise I fall back to querying all providers, in order to not loose results from old search providers.

@PVince81

Copy link
Copy Markdown
Contributor

Got it, makes sense 👍

butonic added a commit that referenced this pull request Dec 15, 2014
introduce inApps[] filter for search via ajax query
@butonic
butonic merged commit 6602d3a into master Dec 15, 2014
@butonic
butonic deleted the app_specific_search branch December 15, 2014 15:14
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants