@Override public void checkCompatibility(MappedFieldType otherFT, List<String> conflicts, boolean strict) { super.checkCompatibility(otherFT, conflicts, strict); KeywordFieldType other = (KeywordFieldType) otherFT; if (Objects.equals(normalizer, other.normalizer) == false) { conflicts.add("mapper [" + name() + "] has different [normalizer]"); } if (strict) { if (splitQueriesOnWhitespace != other.splitQueriesOnWhitespace) { conflicts.add("mapper [" + name() + "] is used by multiple types. Set update_all_types" + " to true to update [split_queries_on_whitespace] across all types."); } } }
boolean parent = context.docMapper().isParent(context.sourceToParse().type()); if (parent) { fields.add(new SortedDocValuesField(parentJoinField.fieldType().name(), new BytesRef(context.sourceToParse().id())));
boolean parent = context.docMapper().isParent(context.sourceToParse().type()); if (parent) { fields.add(new SortedDocValuesField(parentJoinField.fieldType().name(), new BytesRef(context.sourceToParse().id())));
boolean parent = context.docMapper().isParent(context.sourceToParse().type()); if (parent) { fields.add(new SortedDocValuesField(parentJoinField.fieldType().name(), new BytesRef(context.sourceToParse().id())));
@Override protected BytesRef indexedValueForSearch(Object value) { if (searchAnalyzer() == Lucene.KEYWORD_ANALYZER) { // keyword analyzer with the default attribute source which encodes terms using UTF8 // in that case we skip normalization, which may be slow if there many terms need to // parse (eg. large terms query) since Analyzer.normalize involves things like creating // attributes through reflection // This if statement will be used whenever a normalizer is NOT configured return super.indexedValueForSearch(value); } if (value == null) { return null; } if (value instanceof BytesRef) { value = ((BytesRef) value).utf8ToString(); } return searchAnalyzer().normalize(name(), value.toString()); } }
@Override protected BytesRef indexedValueForSearch(Object value) { if (searchAnalyzer() == Lucene.KEYWORD_ANALYZER) { // keyword analyzer with the default attribute source which encodes terms using UTF8 // in that case we skip normalization, which may be slow if there many terms need to // parse (eg. large terms query) since Analyzer.normalize involves things like creating // attributes through reflection // This if statement will be used whenever a normalizer is NOT configured return super.indexedValueForSearch(value); } if (value == null) { return null; } if (value instanceof BytesRef) { value = ((BytesRef) value).utf8ToString(); } return searchAnalyzer().normalize(name(), value.toString()); } }
@Override public BytesRef indexedValueForSearch(Object value) { if (searchAnalyzer() == Lucene.KEYWORD_ANALYZER) { // keyword analyzer with the default attribute source which encodes terms using UTF8 // in that case we skip normalization, which may be slow if there many terms need to // parse (eg. large terms query) since Analyzer.normalize involves things like creating // attributes through reflection // This if statement will be used whenever a normalizer is NOT configured return super.indexedValueForSearch(value); } if (value == null) { return null; } if (value instanceof BytesRef) { value = ((BytesRef) value).utf8ToString(); } return searchAnalyzer().normalize(name(), value.toString()); } }
@Override public void createField(ParseContext context, Object value) throws IOException { String parentId = (String) value; boolean parent = context.docMapper().isParent(context.type()); if (parent) { //addJoinFieldIfNeeded(context, parentJoinFieldType, context.id()); context.doc().add(new SortedDocValuesField(parentJoinField.fieldType().name(), new BytesRef(context.id()))); } if (!active()) { return; } context.doc().add(new SortedDocValuesField(fieldType.name(), new BytesRef(parentId))); //addJoinFieldIfNeeded(context, childJoinFieldType, parentId); // we have parent mapping, yet no value was set, ignore it... }
@Override public void checkCompatibility(MappedFieldType otherFT, List<String> conflicts, boolean strict) { super.checkCompatibility(otherFT, conflicts, strict); KeywordFieldType other = (KeywordFieldType) otherFT; if (Objects.equals(normalizer, other.normalizer) == false) { conflicts.add("mapper [" + name() + "] has different [normalizer]"); } if (strict) { if (splitQueriesOnWhitespace != other.splitQueriesOnWhitespace) { conflicts.add("mapper [" + name() + "] is used by multiple types. Set update_all_types" + " to true to update [split_queries_on_whitespace] across all types."); } } }
@Override public void checkCompatibility(MappedFieldType otherFT, List<String> conflicts, boolean strict) { super.checkCompatibility(otherFT, conflicts, strict); KeywordFieldType other = (KeywordFieldType) otherFT; if (Objects.equals(normalizer, other.normalizer) == false) { conflicts.add("mapper [" + name() + "] has different [normalizer]"); } if (strict) { if (splitQueriesOnWhitespace != other.splitQueriesOnWhitespace) { conflicts.add("mapper [" + name() + "] is used by multiple types. Set update_all_types" + " to true to update [split_queries_on_whitespace] across all types."); } } }
@Override public void checkCompatibility(MappedFieldType otherFT, List<String> conflicts, boolean strict) { super.checkCompatibility(otherFT, conflicts, strict); KeywordFieldType other = (KeywordFieldType) otherFT; if (Objects.equals(normalizer, other.normalizer) == false) { conflicts.add("mapper [" + name() + "] has different [normalizer]"); } }
boolean parent = context.docMapper().isParent(context.sourceToParse().type()); if (parent) { fields.add(new SortedDocValuesField(parentJoinField.fieldType().name(), new BytesRef(context.sourceToParse().id())));
@Override protected BytesRef indexedValueForSearch(Object value) { if (searchAnalyzer() == Lucene.KEYWORD_ANALYZER) { // keyword analyzer with the default attribute source which encodes terms using UTF8 // in that case we skip normalization, which may be slow if there many terms need to // parse (eg. large terms query) since Analyzer.normalize involves things like creating // attributes through reflection // This if statement will be used whenever a normalizer is NOT configured return super.indexedValueForSearch(value); } if (value == null) { return null; } if (value instanceof BytesRef) { value = ((BytesRef) value).utf8ToString(); } return searchAnalyzer().normalize(name(), value.toString()); } }