/
githubmirror
/
the-algorithm
Обзор
Документация
Войти
/
githubmirror
/
the-algorithm
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/java/com/twitter/search/earlybird/common/RequestResponsePair.java
44 строки
1 KB
twitter-team
Twitter Recommendation Algorithm
01 апр 2023, 01:36
01 апр 2023, 01:36
ef4c5eb
Код
Авторство
О чём код?
package com.twitter.search.earlybird.common; import org.apache.lucene.search.Query; import com.twitter.search.earlybird.thrift.EarlybirdRequest; import com.twitter.search.earlybird.thrift.EarlybirdResponse; public class RequestResponsePair { private final EarlybirdRequest request; private final EarlybirdResponse response; private final org.apache.lucene.search.Query luceneQuery; // The serialized query in its final form, after various modifications have been applied to it. // As a note, we have some code paths in which this can be null, but I don't really see them // triggered in production right now. private final com.twitter.search.queryparser.query.Query finalSerializedQuery; public RequestResponsePair( EarlybirdRequest request, com.twitter.search.queryparser.query.Query finalSerializedQuery, org.apache.lucene.search.Query luceneQuery, EarlybirdResponse response) { this.request = request; this.luceneQuery = luceneQuery; this.response = response; this.finalSerializedQuery = finalSerializedQuery; } public String getFinalSerializedQuery() { return finalSerializedQuery != null ? finalSerializedQuery.serialize() : "N/A"; } public EarlybirdRequest getRequest() { return request; } public EarlybirdResponse getResponse() { return response; } public Query getLuceneQuery() { return luceneQuery; } }