Synapse: Searching across all rooms is broken.

Created on 8 Apr 2018  路  2Comments  路  Source: matrix-org/synapse

sierra:~ matthew$ curl 'https://matrix.org/_matrix/client/r0/search?' ... --data-binary '{"search_categories":{"room_events":{"search_term":"attestation","filter":{},"order_by":"recent","event_context":{"before_limit":1,"after_limit":1,"include_profile":true}}}}'

->

{"search_categories": {"room_events": {"count": 201, "highlights": [], "results": []}}}

So I get a count of 201 results but an empty results array :|

bug p1

Most helpful comment

Tried this today and it's working for me?

All 2 comments

Tried this today and it's working for me?

A customer ran problems with /search today. After submitting the following server side search request to search for rooms a user is a member of:

{
  "search_categories" : {
    "room_events" : {
      "search_term" : "abc",
      "keys" : [ "content.name" ],
      "filter" : {
        "limit" : 10,
        "types" : [ "m.room.name" ]
      },
      "order_by" : "recent",
      "event_context" : {
        "before_limit" : 0,
        "after_limit" : 0,
        "include_profile" : false
      },
      "include_state" : false,
      "groupings" : {
        "group_by" : [ {
          "key" : "room_id"
        } ]
      }
    }
  }
}

it returns a count of 5 and 5 highlights corresponding to the 5 room names expected to match the search term. However, only 2 items in each of the results and groups arrays were returned:

{
  "search_categories" : {
    "room_events" : {
      "count" : 5,
      "highlights" : [ "abc - room1", "abc - room2", "abc - room3", "abc", "abc - room 4" ],
      "results" : [ {
        "rank" : 0.1,
        "result" : {
          "type" : "m.room.name",
           // ...
     } ],
      "state" : null,
      "groups" : {
        "room_id" : {
          "!oneroom:example.com" : {
            "next_batch" : null,
            "order" : null,
            "results" : [ "$12345" ]
          },
          "!tworoom:example.com" : {
            "next_batch" : null,
            "order" : null,
            "results" : [ "$54321" ]
          }
        },
        "sender" : null
      },
      "next_batch" : null
    }
  }
}

It appears the results only include rooms that the requesting user is the administrator of. In the other 3 room they are an unpriviledged user. As they are a member of the room, why are these 3 non-admin rooms being excluded in the search results?

Was this page helpful?
0 / 5 - 0 ratings