com.yelp.nrtsearch.server.grpc.MatchPhraseQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clientlib Show documentation
Show all versions of clientlib Show documentation
GRPC Clientlib for nrtSearch
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: yelp/nrtsearch/search.proto
// Protobuf Java Version: 3.25.3
package com.yelp.nrtsearch.server.grpc;
/**
*
* A query that analyzes the text before finding matching documents. The tokens resulting from the analysis are combined into a PhraseQuery.
*
*
* Protobuf type {@code luceneserver.MatchPhraseQuery}
*/
public final class MatchPhraseQuery extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:luceneserver.MatchPhraseQuery)
MatchPhraseQueryOrBuilder {
private static final long serialVersionUID = 0L;
// Use MatchPhraseQuery.newBuilder() to construct.
private MatchPhraseQuery(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MatchPhraseQuery() {
field_ = "";
query_ = "";
zeroTermsQuery_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new MatchPhraseQuery();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_MatchPhraseQuery_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_MatchPhraseQuery_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.class, com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.Builder.class);
}
/**
*
* Zero Terms options when analyzer removes all tokens.
*
*
* Protobuf enum {@code luceneserver.MatchPhraseQuery.ZeroTerms}
*/
public enum ZeroTerms
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* No documents are returned if the analyzer removes all tokens.
*
*
* NONE_ZERO_TERMS = 0;
*/
NONE_ZERO_TERMS(0),
/**
*
* All documents are returned if the analyzer removes all tokens.
*
*
* ALL_ZERO_TERMS = 1;
*/
ALL_ZERO_TERMS(1),
UNRECOGNIZED(-1),
;
/**
*
* No documents are returned if the analyzer removes all tokens.
*
*
* NONE_ZERO_TERMS = 0;
*/
public static final int NONE_ZERO_TERMS_VALUE = 0;
/**
*
* All documents are returned if the analyzer removes all tokens.
*
*
* ALL_ZERO_TERMS = 1;
*/
public static final int ALL_ZERO_TERMS_VALUE = 1;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ZeroTerms valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static ZeroTerms forNumber(int value) {
switch (value) {
case 0: return NONE_ZERO_TERMS;
case 1: return ALL_ZERO_TERMS;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ZeroTerms> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public ZeroTerms findValueByNumber(int number) {
return ZeroTerms.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.getDescriptor().getEnumTypes().get(0);
}
private static final ZeroTerms[] VALUES = values();
public static ZeroTerms valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private ZeroTerms(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:luceneserver.MatchPhraseQuery.ZeroTerms)
}
private int bitField0_;
public static final int FIELD_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object field_ = "";
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @return The field.
*/
@java.lang.Override
public java.lang.String getField() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
field_ = s;
return s;
}
}
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @return The bytes for field.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int QUERY_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object query_ = "";
/**
*
* The text to query with.
*
*
* string query = 2;
* @return The query.
*/
@java.lang.Override
public java.lang.String getQuery() {
java.lang.Object ref = query_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
query_ = s;
return s;
}
}
/**
*
* The text to query with.
*
*
* string query = 2;
* @return The bytes for query.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getQueryBytes() {
java.lang.Object ref = query_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
query_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SLOP_FIELD_NUMBER = 3;
private int slop_ = 0;
/**
*
* Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document.
*
*
* int32 slop = 3;
* @return The slop.
*/
@java.lang.Override
public int getSlop() {
return slop_;
}
public static final int ANALYZER_FIELD_NUMBER = 4;
private com.yelp.nrtsearch.server.grpc.Analyzer analyzer_;
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
* @return Whether the analyzer field is set.
*/
@java.lang.Override
public boolean hasAnalyzer() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
* @return The analyzer.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.Analyzer getAnalyzer() {
return analyzer_ == null ? com.yelp.nrtsearch.server.grpc.Analyzer.getDefaultInstance() : analyzer_;
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.AnalyzerOrBuilder getAnalyzerOrBuilder() {
return analyzer_ == null ? com.yelp.nrtsearch.server.grpc.Analyzer.getDefaultInstance() : analyzer_;
}
public static final int ZEROTERMSQUERY_FIELD_NUMBER = 5;
private int zeroTermsQuery_ = 0;
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @return The enum numeric value on the wire for zeroTermsQuery.
*/
@java.lang.Override public int getZeroTermsQueryValue() {
return zeroTermsQuery_;
}
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @return The zeroTermsQuery.
*/
@java.lang.Override public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms getZeroTermsQuery() {
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms result = com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.forNumber(zeroTermsQuery_);
return result == null ? com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_);
}
if (slop_ != 0) {
output.writeInt32(3, slop_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(4, getAnalyzer());
}
if (zeroTermsQuery_ != com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.NONE_ZERO_TERMS.getNumber()) {
output.writeEnum(5, zeroTermsQuery_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_);
}
if (slop_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, slop_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getAnalyzer());
}
if (zeroTermsQuery_ != com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.NONE_ZERO_TERMS.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, zeroTermsQuery_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.yelp.nrtsearch.server.grpc.MatchPhraseQuery)) {
return super.equals(obj);
}
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery other = (com.yelp.nrtsearch.server.grpc.MatchPhraseQuery) obj;
if (!getField()
.equals(other.getField())) return false;
if (!getQuery()
.equals(other.getQuery())) return false;
if (getSlop()
!= other.getSlop()) return false;
if (hasAnalyzer() != other.hasAnalyzer()) return false;
if (hasAnalyzer()) {
if (!getAnalyzer()
.equals(other.getAnalyzer())) return false;
}
if (zeroTermsQuery_ != other.zeroTermsQuery_) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + FIELD_FIELD_NUMBER;
hash = (53 * hash) + getField().hashCode();
hash = (37 * hash) + QUERY_FIELD_NUMBER;
hash = (53 * hash) + getQuery().hashCode();
hash = (37 * hash) + SLOP_FIELD_NUMBER;
hash = (53 * hash) + getSlop();
if (hasAnalyzer()) {
hash = (37 * hash) + ANALYZER_FIELD_NUMBER;
hash = (53 * hash) + getAnalyzer().hashCode();
}
hash = (37 * hash) + ZEROTERMSQUERY_FIELD_NUMBER;
hash = (53 * hash) + zeroTermsQuery_;
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.yelp.nrtsearch.server.grpc.MatchPhraseQuery prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A query that analyzes the text before finding matching documents. The tokens resulting from the analysis are combined into a PhraseQuery.
*
*
* Protobuf type {@code luceneserver.MatchPhraseQuery}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:luceneserver.MatchPhraseQuery)
com.yelp.nrtsearch.server.grpc.MatchPhraseQueryOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_MatchPhraseQuery_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_MatchPhraseQuery_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.class, com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.Builder.class);
}
// Construct using com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getAnalyzerFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
field_ = "";
query_ = "";
slop_ = 0;
analyzer_ = null;
if (analyzerBuilder_ != null) {
analyzerBuilder_.dispose();
analyzerBuilder_ = null;
}
zeroTermsQuery_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yelp.nrtsearch.server.grpc.SearchResponseProto.internal_static_luceneserver_MatchPhraseQuery_descriptor;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery getDefaultInstanceForType() {
return com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.getDefaultInstance();
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery build() {
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery buildPartial() {
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery result = new com.yelp.nrtsearch.server.grpc.MatchPhraseQuery(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.yelp.nrtsearch.server.grpc.MatchPhraseQuery result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.field_ = field_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.query_ = query_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.slop_ = slop_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000008) != 0)) {
result.analyzer_ = analyzerBuilder_ == null
? analyzer_
: analyzerBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.zeroTermsQuery_ = zeroTermsQuery_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.yelp.nrtsearch.server.grpc.MatchPhraseQuery) {
return mergeFrom((com.yelp.nrtsearch.server.grpc.MatchPhraseQuery)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.MatchPhraseQuery other) {
if (other == com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.getDefaultInstance()) return this;
if (!other.getField().isEmpty()) {
field_ = other.field_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getQuery().isEmpty()) {
query_ = other.query_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.getSlop() != 0) {
setSlop(other.getSlop());
}
if (other.hasAnalyzer()) {
mergeAnalyzer(other.getAnalyzer());
}
if (other.zeroTermsQuery_ != 0) {
setZeroTermsQueryValue(other.getZeroTermsQueryValue());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
field_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
query_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
slop_ = input.readInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 34: {
input.readMessage(
getAnalyzerFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
case 40: {
zeroTermsQuery_ = input.readEnum();
bitField0_ |= 0x00000010;
break;
} // case 40
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object field_ = "";
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @return The field.
*/
public java.lang.String getField() {
java.lang.Object ref = field_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
field_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @return The bytes for field.
*/
public com.google.protobuf.ByteString
getFieldBytes() {
java.lang.Object ref = field_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
field_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @param value The field to set.
* @return This builder for chaining.
*/
public Builder setField(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
field_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @return This builder for chaining.
*/
public Builder clearField() {
field_ = getDefaultInstance().getField();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* Field in the document to query.
*
*
* string field = 1;
* @param value The bytes for field to set.
* @return This builder for chaining.
*/
public Builder setFieldBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
field_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object query_ = "";
/**
*
* The text to query with.
*
*
* string query = 2;
* @return The query.
*/
public java.lang.String getQuery() {
java.lang.Object ref = query_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
query_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The text to query with.
*
*
* string query = 2;
* @return The bytes for query.
*/
public com.google.protobuf.ByteString
getQueryBytes() {
java.lang.Object ref = query_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
query_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The text to query with.
*
*
* string query = 2;
* @param value The query to set.
* @return This builder for chaining.
*/
public Builder setQuery(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
query_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The text to query with.
*
*
* string query = 2;
* @return This builder for chaining.
*/
public Builder clearQuery() {
query_ = getDefaultInstance().getQuery();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* The text to query with.
*
*
* string query = 2;
* @param value The bytes for query to set.
* @return This builder for chaining.
*/
public Builder setQueryBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
query_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private int slop_ ;
/**
*
* Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document.
*
*
* int32 slop = 3;
* @return The slop.
*/
@java.lang.Override
public int getSlop() {
return slop_;
}
/**
*
* Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document.
*
*
* int32 slop = 3;
* @param value The slop to set.
* @return This builder for chaining.
*/
public Builder setSlop(int value) {
slop_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* Edit distance between respective positions of tokens generated by analyzing this query and the positions of terms in a document.
*
*
* int32 slop = 3;
* @return This builder for chaining.
*/
public Builder clearSlop() {
bitField0_ = (bitField0_ & ~0x00000004);
slop_ = 0;
onChanged();
return this;
}
private com.yelp.nrtsearch.server.grpc.Analyzer analyzer_;
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.Analyzer, com.yelp.nrtsearch.server.grpc.Analyzer.Builder, com.yelp.nrtsearch.server.grpc.AnalyzerOrBuilder> analyzerBuilder_;
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
* @return Whether the analyzer field is set.
*/
public boolean hasAnalyzer() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
* @return The analyzer.
*/
public com.yelp.nrtsearch.server.grpc.Analyzer getAnalyzer() {
if (analyzerBuilder_ == null) {
return analyzer_ == null ? com.yelp.nrtsearch.server.grpc.Analyzer.getDefaultInstance() : analyzer_;
} else {
return analyzerBuilder_.getMessage();
}
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public Builder setAnalyzer(com.yelp.nrtsearch.server.grpc.Analyzer value) {
if (analyzerBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
analyzer_ = value;
} else {
analyzerBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public Builder setAnalyzer(
com.yelp.nrtsearch.server.grpc.Analyzer.Builder builderForValue) {
if (analyzerBuilder_ == null) {
analyzer_ = builderForValue.build();
} else {
analyzerBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public Builder mergeAnalyzer(com.yelp.nrtsearch.server.grpc.Analyzer value) {
if (analyzerBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0) &&
analyzer_ != null &&
analyzer_ != com.yelp.nrtsearch.server.grpc.Analyzer.getDefaultInstance()) {
getAnalyzerBuilder().mergeFrom(value);
} else {
analyzer_ = value;
}
} else {
analyzerBuilder_.mergeFrom(value);
}
if (analyzer_ != null) {
bitField0_ |= 0x00000008;
onChanged();
}
return this;
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public Builder clearAnalyzer() {
bitField0_ = (bitField0_ & ~0x00000008);
analyzer_ = null;
if (analyzerBuilder_ != null) {
analyzerBuilder_.dispose();
analyzerBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public com.yelp.nrtsearch.server.grpc.Analyzer.Builder getAnalyzerBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getAnalyzerFieldBuilder().getBuilder();
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
public com.yelp.nrtsearch.server.grpc.AnalyzerOrBuilder getAnalyzerOrBuilder() {
if (analyzerBuilder_ != null) {
return analyzerBuilder_.getMessageOrBuilder();
} else {
return analyzer_ == null ?
com.yelp.nrtsearch.server.grpc.Analyzer.getDefaultInstance() : analyzer_;
}
}
/**
*
* Analyzer used to analyze the query. If not provided, the default search analyzer for the field would be used instead.
*
*
* .luceneserver.Analyzer analyzer = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.Analyzer, com.yelp.nrtsearch.server.grpc.Analyzer.Builder, com.yelp.nrtsearch.server.grpc.AnalyzerOrBuilder>
getAnalyzerFieldBuilder() {
if (analyzerBuilder_ == null) {
analyzerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.yelp.nrtsearch.server.grpc.Analyzer, com.yelp.nrtsearch.server.grpc.Analyzer.Builder, com.yelp.nrtsearch.server.grpc.AnalyzerOrBuilder>(
getAnalyzer(),
getParentForChildren(),
isClean());
analyzer_ = null;
}
return analyzerBuilder_;
}
private int zeroTermsQuery_ = 0;
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @return The enum numeric value on the wire for zeroTermsQuery.
*/
@java.lang.Override public int getZeroTermsQueryValue() {
return zeroTermsQuery_;
}
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @param value The enum numeric value on the wire for zeroTermsQuery to set.
* @return This builder for chaining.
*/
public Builder setZeroTermsQueryValue(int value) {
zeroTermsQuery_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @return The zeroTermsQuery.
*/
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms getZeroTermsQuery() {
com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms result = com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.forNumber(zeroTermsQuery_);
return result == null ? com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms.UNRECOGNIZED : result;
}
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @param value The zeroTermsQuery to set.
* @return This builder for chaining.
*/
public Builder setZeroTermsQuery(com.yelp.nrtsearch.server.grpc.MatchPhraseQuery.ZeroTerms value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
zeroTermsQuery_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Indicates whether none or all documents are returned if the analyzer removes all tokens. Valid values are NONE_ZERO_TERMS and ALL_ZERO_TERMS.
*
*
* .luceneserver.MatchPhraseQuery.ZeroTerms zeroTermsQuery = 5;
* @return This builder for chaining.
*/
public Builder clearZeroTermsQuery() {
bitField0_ = (bitField0_ & ~0x00000010);
zeroTermsQuery_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:luceneserver.MatchPhraseQuery)
}
// @@protoc_insertion_point(class_scope:luceneserver.MatchPhraseQuery)
private static final com.yelp.nrtsearch.server.grpc.MatchPhraseQuery DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.MatchPhraseQuery();
}
public static com.yelp.nrtsearch.server.grpc.MatchPhraseQuery getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MatchPhraseQuery parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.MatchPhraseQuery getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}