indieweb / microsub

For tracking issues on the Microsub specification
23 stars 0 forks source link

Searching feeds and (proposed) searching content are close but different #33

Open sebsel opened 5 years ago

sebsel commented 5 years ago

Hard to find a title on this one.

The spec mentions a POST for action=search&query=aaronparecki.com as a way to search feeds to subscribe on. Together is using this feature to find feeds to subscribe to.

The spec also mentions a POST for action=search&channel=x-uid-x&query=words, as a way to search within a channel for certain posts. They differ by the addition of channel, which is a very small difference, while they are very different endpoints.

I would argue that the first one is more closely related to action=preview&url=xx and that it could be better represented as action=preview&query=aaronparecki.com.

In a non-logged chat @aaronpk noted that the search actually is more a search than a preview, because in the example (below) 'percolator.today' is only found because 'aaronparecki.com' is in the response. So it's actually a search.

POST /microsub
Content-type: application/x-www-form-urlencoded

action=search&query=aaronparecki.com

Response

HTTP/1.1 200 Ok
Content-type: application/json

{
  "results": [
    {
      "type": "feed",
      "url": "https://aaronparecki.com/",
      "name": "Aaron Parecki",
      "photo": "https://aaronparecki.com/images/profile.jpg",
      "description": "Aaron Parecki's home page"
    },
    {
      "type": "feed",
      "url": "https://percolator.today/",
      "name": "Percolator",
      "photo": "https://percolator.today/images/cover.jpg",
      "description": "A Microcast by Aaron Parecki",
      "author": {
        "name": "Aaron Parecki",
        "url": "https://aaronparecki.com/",
        "photo": "https://aaronparecki.com/images/profile.jpg"
      }
    },
    { ... }
  ]
}
swentel commented 5 years ago

Indigenous for Android allows search for feeds to based on URL and then subscribe to it.

I'd love to add a feature to just search for (a) post(s) that are already indexed by the server, either globally over all channels, or within a channel. This is partially described in https://indieweb.org/Microsub-spec#Searching_for_Content - but it would only allow me to implement this per channel while I think it might be useful to have this across all channels, because otherwise you need to first know which channel you need to go into to search for a certain post you'd like to see back again.

So a nicer distinction between the two would be easier for both server and client I think.

EdwardHinkle commented 5 years ago

I agree both search within a channel and searching global would be super useful. In features I'd like to add to Indigenous for iOS, is a search field that defaults to "within current channel", but then having an option to click and do the same search globally across all channels.

swentel commented 5 years ago

Implemented in Drupal module and Indigenous. Works pretty neat already. Global would be nice. Let's see after I pushed if we hear any feedback.