8080 *
8181 * <p>You provide a streaming expression that is parsed and loaded by the component to stream query
8282 * data to a target of your choice. If you do not, then the default expression of
83- * 'logging(ubi_queries.jsonl,ubiQuery())" ' is used which logs data to
83+ * 'logging(ubi_queries.jsonl,ubiQuery())' is used which logs data to
8484 * $SOLR_HOME/userfiles/ubi_queries.jsonl file.
8585 *
8686 * <p>You must source your streaming events using the 'ubiQuery()' streaming expression to retrieve
9494 *
9595 * <pre class="prettyprint">
9696 * <searchComponent name="ubi" class="solr.UBIComponent"/>
97- *
9897 * <requestHandler name="/select" class="solr.SearchHandler">
9998 * <lst name="defaults">
100- *
10199 * ...
102- *
103100 * </lst>
104101 * <arr name="components">
105102 * <str>ubi</str>
@@ -270,11 +267,11 @@ public int distributedProcess(ResponseBuilder rb) throws IOException {
270267
271268 // Wait until STAGE_GET_FIELDS when rb.resultIds contains the merged document IDs
272269 // from all shards, representing the final result set returned to the user
273- if (rb .stage < ResponseBuilder .STAGE_GET_FIELDS ) {
270+ if (rb .getStage () < ResponseBuilder .STAGE_GET_FIELDS ) {
274271 return ResponseBuilder .STAGE_GET_FIELDS ;
275272 }
276273
277- if (rb .stage == ResponseBuilder .STAGE_GET_FIELDS ) {
274+ if (rb .getStage () == ResponseBuilder .STAGE_GET_FIELDS ) {
278275 // In distributed mode, rb.resultIds.keySet() contains the unique key values
279276 // from all shards, merged and sorted by the coordinator
280277 storeUbiDetails (
@@ -330,13 +327,13 @@ private static UBIQuery getUbiQuery(ResponseBuilder rb) {
330327 if (ubiQuery .getApplication () == null ) {
331328 ubiQuery .setApplication (
332329 rb .isDistrib
333- ? rb .req .getCloudDescriptor ().getCollectionName ()
330+ ? rb .req .getCore (). getCoreDescriptor ().getCollectionName ()
334331 : searcher .getCore ().getName ());
335332 }
336333
337334 String queryAttributes = params .get (QUERY_ATTRIBUTES );
338335
339- if (queryAttributes != null && queryAttributes .toString (). startsWith ("{" )) {
336+ if (queryAttributes != null && queryAttributes .startsWith ("{" )) {
340337 // Look up the original nested JSON format, typically passed in
341338 // via the JSON formatted query.
342339 @ SuppressWarnings ("rawtypes" )
@@ -490,15 +487,15 @@ public String getDescription() {
490487 /**
491488 * Handles all the data required for tracking a query using User Behavior Insights.
492489 *
493- * <p>Compatible with the
494- * https://github.com/o19s/ubi/blob/main/schema/1.2.0/query.request.schema.json.
490+ * <p>Compatible with the <a
491+ * href=" https://github.com/o19s/ubi/blob/main/schema/1.2.0/query.request.schema.json">...</a> .
495492 */
496493 public static class UBIQuery {
497494
498495 private String application ;
499496 private String queryId ;
500497 private String userQuery ;
501- private Date timestamp ;
498+ private final Date timestamp ;
502499
503500 @ SuppressWarnings ("rawtypes" )
504501 private Map queryAttributes ;
@@ -530,10 +527,6 @@ public String getQueryId() {
530527 return queryId ;
531528 }
532529
533- public void setQueryId (String queryId ) {
534- this .queryId = queryId ;
535- }
536-
537530 public String getUserQuery () {
538531 return userQuery ;
539532 }
@@ -542,11 +535,6 @@ public void setUserQuery(String userQuery) {
542535 this .userQuery = userQuery ;
543536 }
544537
545- @ SuppressWarnings ("rawtypes" )
546- public Map getQueryAttributes () {
547- return queryAttributes ;
548- }
549-
550538 @ SuppressWarnings ("rawtypes" )
551539 public void setQueryAttributes (Map queryAttributes ) {
552540 this .queryAttributes = queryAttributes ;
@@ -562,7 +550,7 @@ public void setDocIds(String docIds) {
562550
563551 @ SuppressWarnings ({"rawtypes" , "unchecked" })
564552 public Map toMap () {
565- @ SuppressWarnings ({"rawtypes" , "unchecked" })
553+ @ SuppressWarnings ({"rawtypes" })
566554 Map map = new HashMap ();
567555 map .put (QUERY_ID , this .queryId );
568556 map .put (
@@ -596,8 +584,8 @@ public Map toMap() {
596584 * and returns it.
597585 *
598586 * <p>I suspect that if I had the right magic with a LetStream or a GetStream, I could somehow
599- * just use that to say "pluck the 'ubi-query' object out of the StreamContext and call .toTuple
600- * or make a map of it and that would be my tuple' .
587+ * just use that to "pluck" the 'ubi-query' object out of the StreamContext and call .toTuple or
588+ * make a map of it and that would be my tuple.
601589 */
602590 public static class UBIQueryStream extends TupleStream implements Expressible {
603591
0 commit comments