-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the 'array value parser' marker interface. #57571
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
import org.elasticsearch.common.xcontent.XContentParser.Token; | ||
import org.elasticsearch.common.xcontent.support.XContentMapValues; | ||
import org.elasticsearch.index.fielddata.IndexFieldData; | ||
import org.elasticsearch.index.mapper.ArrayValueMapperParser; | ||
import org.elasticsearch.index.mapper.FieldMapper; | ||
import org.elasticsearch.index.mapper.MappedFieldType; | ||
import org.elasticsearch.index.mapper.Mapper; | ||
|
@@ -40,7 +39,7 @@ | |
/** | ||
* A {@link FieldMapper} for indexing a dense vector of floats. | ||
*/ | ||
public class DenseVectorFieldMapper extends FieldMapper implements ArrayValueMapperParser { | ||
public class DenseVectorFieldMapper extends FieldMapper { | ||
|
||
public static final String CONTENT_TYPE = "dense_vector"; | ||
public static short MAX_DIMS_COUNT = 2048; //maximum allowed number of dimensions | ||
|
@@ -173,6 +172,11 @@ public DenseVectorFieldType fieldType() { | |
return (DenseVectorFieldType) super.fieldType(); | ||
} | ||
|
||
@Override | ||
public boolean parsesArrayValue() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be final, like AbstractGeometryFieldMapper does? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me this could be a bit confusing, because no other methods on |
||
return true; | ||
} | ||
|
||
@Override | ||
public void parse(ParseContext context) throws IOException { | ||
if (context.externalValueSet()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this refactor didn't actually cut down on the number of
instanceof
checks. But I feel better about this one, because it's very common for us to checkinstanceof
againstFieldMapper
orObjectMapper
-- it's just part of how mappings + document parsing currently work.