Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How to invoke V2RoomSearchCriteria API to fetch the RoomId?

Hi, I have created a room and want to upate it from my bot. I am trying to use V2RoomSearchCriteria to search my room first then retrieve roomId to further use it to update room details and add remove members. Can you please show an example how to populate the V2RoomSearchCriteria object? What will be the query specifically to retrieve the roomId?

NOTE : I am using JAVA 8.

I tried someting like this..

V2RoomSearchCriteria sc = new V2RoomSearchCriteria(); // ** want to know how to set the search criteria here** 
V3RoomSearchResults roomSearchResults = bdk.streams().searchRooms(sc);

V3RoomDetail v3RoomDetail1 = roomSearchResults.getRooms().get(0); // retrieve the room info assuming the search criteria fetches a single room
// Add a member to the new room
String roomId = v3RoomDetail1.getRoomSystemInfo().getId();  // retrieve the roomid.
bdk.streams().addMemberToRoom(userId1, roomId);

Thanks in advance.

  
  
Posted 2 years ago
Edited 2 years ago
Votes Newest

Answers


You can use the attributes in V2RoomSearchCriteria to set the search criteria. For free-text search on the room name, just use the query attribute. You'd then want to verify that the search results are not empty before extracting the room attributes.

V2RoomSearchCriteria criteria = new V2RoomSearchCriteria().query("Deal Room 123");
V3RoomSearchResults results = bdk.streams().searchRooms(criteria);
if (results.getCount() >= 1) {
  String roomId = results.getRooms().get(0).getRoomSystemInfo().getId();
  bdk.streams().addMemberToRoom(someUserId, roomId);
}

You can also have a look at the corresponding REST endpoint docs for other attributes.
https://developers.symphony.com/restapi/reference/search-rooms-v3

2
2
Posted 2 years ago
Edited 2 years ago
Yong Sheng Tan
39 × 2 Administrator
9K Views
1 Answer
2 years ago
2 years ago
Tags