microsub icon indicating copy to clipboard operation
microsub copied to clipboard

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

Open sebsel opened this issue 7 years ago • 3 comments

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"
      }
    },
    { ... }
  ]
}

sebsel avatar Nov 08 '18 19:11 sebsel

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.

swentel avatar Apr 12 '19 20:04 swentel

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.

EdwardHinkle avatar Apr 12 '19 20:04 EdwardHinkle

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.

swentel avatar Apr 12 '19 23:04 swentel