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

Implement more gambits #418

Open
tobyzerner opened this issue Aug 27, 2015 · 7 comments
Open

Implement more gambits #418

tobyzerner opened this issue Aug 27, 2015 · 7 comments
Labels

Comments

@tobyzerner
Copy link

tobyzerner commented Aug 27, 2015

Gambits are little pieces of search criteria that can be specified in the search string. Just like GitHub's search syntax.

Right now we've only implemented a few: is:unread and author:username in core, and tag:foo,bar, is:followed, is:ignored, is:sticky, and is:locked in their respective extensions.

We probably want to implement the following gambits:

  • Multiple author search, separated by commas (author:username1,username2)
  • created:date where date is the same syntax as on GitHub
  • updated:date
  • contributor:username1,username2
  • replies:number where number is the same syntax as on GitHub
  • ip:123.123.123.123

Pending flarum/framework#257, we will also want to have an in:title gambit which scopes fulltext search to only look in discussion titles.

We should also implement more gambits when searching users (i.e. /api/users?q=whatever), such as for filtering by group.

This is a precursor to an extensible advanced search interface which will come later.

@Albert221
Copy link

See flarum/framework#703.

tobyzerner referenced this issue in flarum/framework Jan 4, 2016
#256 Added multiple author search gambit
franzliedke referenced this issue in flarum/framework Jan 3, 2017
Add group gambit to support search user by group name

/api/users?filter[q]=group:admin
/api/users?filter[q]=group:admin,mod

refer to #256
@BartVB
Copy link
Sponsor

BartVB commented Aug 15, 2017

Can I put in a request for searching by IP address? We use that to track down spammers and their posts. Obviously this should be behind some kind of permission.

@franzliedke
Copy link

@BartVB Good idea. If @tobscure agrees, we can add that to the list at the top of this issue.

@luceos
Copy link
Member

luceos commented Oct 29, 2018

Contributor or participant is related to the author of a post, contrary to the current Author Gambit for Discussions.

@askvortsov1
Copy link
Sponsor Member

This post was made a while ago, and hasn't been updated recently. The following have already been updated:

  • Multiple author search
  • Multiple contributor search (PR)
  • Time Created
  • Time Last Updated (PR)
  • Improvements to fulltext title searching

There are a few more things to consider:

  • Should the created and uploaded gambits be updated offer better support for "before" and "after"? eg: created:before:2020-01-04
  • Do we even want a replies # gambit? This feels like something that would definitely need to be greater than or less than, I can't imagine searching for posts with exactly n replies
  • Do we want to consider permissions in gambits? While it would be nice to search by IP address, that would mean hardwiring in a big chunk of new logic which, frankly, feels like overkill.

@luceos
Copy link
Member

luceos commented Feb 27, 2020

Looking at your discussion on internals (next time please stick to the issue, so that we are not scattering our path of thought everywhere), I think (in my opinion) we need to decide on one date; which to me would make most sense for created_at. I don't think anyone would ever have any need for the other fields and if they do they can either:

  • use the database directly
  • create their own gambit

Having said that, I like what discord did and the argument @datitisev made; keep it stupid simple. Increasing nesting of the namespace (semicolon) will not do our app any good. For this reason I think the PR flarum/framework#2027 should be closed.

PS. as a general remark, if you foresee these kind of decisions it's often better to first discuss the options and then do a PR. Otherwise you spent valuable time on something that might be discarded while risking feeling burned/overruled by a core team decision. Having said so, your efforts are immensely valued, keep it up!

@askvortsov1
Copy link
Sponsor Member

Sounds good! Just to clarify, are you proposing splitting created into multiple gambits to support created_before and created_after? I agree that nesting is kinda gnarly, but I'm also not sure how I feel about having 6 different date gambits.

PR flarum/framework#2027 doesn't have nesting, and I'm not sure that "Updated" isn't useful: It can be good for seeing what conversations / users / areas of discussion are active / inactive with more specificity than just sorting it.

If y'all think we should close it, I'm perfectly fine with that: it was a good opportunity to get to know a part of the codebase I'd never seen before.

@askvortsov1 askvortsov1 transferred this issue from flarum/framework Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants