Skip to content
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

feat: constant keyword field #12285

Merged
merged 32 commits into from
Apr 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8f863dc
feat: constant keyword field
hasnain2808 Feb 11, 2024
e279e42
feat: constant keyword field mapper tests
hasnain2808 Feb 12, 2024
0b299fd
feat: constant keyword field mapper tests
hasnain2808 Feb 12, 2024
ffd9985
feat: remove unwanted elasticsearch blurb
hasnain2808 Feb 12, 2024
e880380
feat: remove unwanted elasticsearch blurb
hasnain2808 Feb 12, 2024
f714ed7
feat: remove unwanted elasticsearch blurb
hasnain2808 Feb 12, 2024
4a60f24
chore: remove unwanted comments
hasnain2808 Feb 12, 2024
80ffe22
chore: remove unallowed system apis
hasnain2808 Feb 13, 2024
ff9ede4
chore: run ./gradlew :server:spotlessApply
hasnain2808 Feb 14, 2024
d67b8aa
chore: Triggering ci
hasnain2808 Feb 14, 2024
96133c6
feat: add wildcard, prefix query support
hasnain2808 Feb 14, 2024
d65029e
test: add wildcard complicated examples like *ault
hasnain2808 Feb 14, 2024
1a62a32
chore: add javadocs
hasnain2808 Feb 15, 2024
6ab5ab2
test: handle AggregatorTestCase.testSupportedFieldTypes
hasnain2808 Feb 15, 2024
602d7ea
test: handle SignificantTextAggregatorTests.testSupportedFieldTypes
hasnain2808 Feb 21, 2024
2b52fd9
test: trigger ci
hasnain2808 Feb 21, 2024
5edbb0b
chore: update public api
hasnain2808 Feb 22, 2024
155521a
test: Fix typo
hasnain2808 Feb 22, 2024
e2852c7
fix: make MappedFieldType.wildcardQuery Final
hasnain2808 Feb 22, 2024
ed4cafb
feature: implement valueFetcher
hasnain2808 Feb 22, 2024
cd6e682
test: add exists query tests
hasnain2808 Mar 14, 2024
b3716a4
test: add no default test
hasnain2808 Mar 14, 2024
fea6b8f
test: formatting
hasnain2808 Mar 14, 2024
79ba93f
Trigger Build
hasnain2808 Mar 15, 2024
d49782c
chore: add CHANGELOG.md entry
hasnain2808 Mar 15, 2024
3408f4a
fix: use constants
hasnain2808 Mar 22, 2024
97b0347
chore: move changelog from 3.x -> 2.x
hasnain2808 Mar 25, 2024
18adb36
chore: remove unwanted changelog changess
hasnain2808 Mar 26, 2024
8125ad1
chore: remove unwanted changelog changess
hasnain2808 Mar 26, 2024
bd3f2f7
chore: make ConstantKeywordFieldType public api
hasnain2808 Mar 27, 2024
330e0ab
fix: make ConstantKeywordFieldType protected
hasnain2808 Mar 30, 2024
917b2bb
chore: trigger ci
hasnain2808 Mar 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: remove unwanted elasticsearch blurb
Signed-off-by: Mohammad Hasnain <[email protected]>
  • Loading branch information
hasnain2808 authored and msfroh committed Apr 1, 2024
commit ffd9985f4409b37ff87fd51a672ee136cebd7c23
Original file line number Diff line number Diff line change
@@ -6,41 +6,14 @@
* compatible open source license.
*/

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.index.mapper;

import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.Query;
import org.opensearch.OpenSearchParseException;
import org.opensearch.common.Explicit;
import org.opensearch.common.Nullable;
import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.xcontent.support.XContentMapValues;
import org.opensearch.core.common.Strings;
import org.opensearch.index.fielddata.IndexFieldData;
import org.opensearch.index.fielddata.plain.ConstantIndexFieldData;
import org.opensearch.index.query.QueryShardContext;
@@ -49,7 +22,10 @@
import org.opensearch.search.lookup.SearchLookup;

import java.io.IOException;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

/**
@@ -60,12 +36,8 @@
@PublicApi(since = "1.0.0")
hasnain2808 marked this conversation as resolved.
Show resolved Hide resolved
public class ConstantKeywordFieldMapper extends ParametrizedFieldMapper {

// public static final String NAME = "_index";

public static final String CONTENT_TYPE = "constant_keyword";

// public static final TypeParser PARSER = new TypeParser((n, c) -> new ConstantKeywordFieldMapper.Builder(n, c));

public static class TypeParser implements Mapper.TypeParser {
@Override
public Mapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
@@ -125,8 +97,6 @@ static final class ConstantKeywordFieldType extends ConstantFieldType {

protected final String value;

// static final ConstantKeywordFieldType INSTANCE = new ConstantKeywordFieldType();

public ConstantKeywordFieldType(String name, String value) {
super(name, Collections.emptyMap());
this.value = value;
Original file line number Diff line number Diff line change
@@ -6,30 +6,6 @@
* compatible open source license.
*/

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.index.mapper;

import org.apache.lucene.search.MatchAllDocsQuery;