-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Upgrade to 7.4.0-snapshot-8fdd3d7584 #30357
Changes from 2 commits
81995dd
0a20aa6
9adc56d
82a87fc
279f76e
25d97b8
9f3abbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
package org.elasticsearch.analysis.common; | ||
|
||
import org.apache.lucene.analysis.TokenStream; | ||
import org.apache.lucene.analysis.miscellaneous.DisableGraphAttribute; | ||
import org.apache.lucene.analysis.shingle.FixedShingleFilter; | ||
import org.apache.lucene.analysis.shingle.ShingleFilter; | ||
import org.elasticsearch.Version; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.env.Environment; | ||
import org.elasticsearch.index.IndexSettings; | ||
import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; | ||
import org.elasticsearch.index.analysis.TokenFilterFactory; | ||
|
||
public class FixedShingleTokenFilterFactory extends AbstractTokenFilterFactory { | ||
private final int shingleSize; | ||
private final String tokenSeparator; | ||
private final String fillerToken; | ||
|
||
public FixedShingleTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) { | ||
super(indexSettings, name, settings); | ||
this.shingleSize = settings.getAsInt("shingle_size", ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE); | ||
this.tokenSeparator = settings.get("token_separator", ShingleFilter.DEFAULT_TOKEN_SEPARATOR); | ||
this.fillerToken = settings.get("filler_token", ShingleFilter.DEFAULT_FILLER_TOKEN); | ||
} | ||
|
||
|
||
@Override | ||
public TokenStream create(TokenStream tokenStream) { | ||
return new FixedShingleFilter(tokenStream, shingleSize, tokenSeparator, fillerToken); | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2b4add2c5d9becd5196bb9b3f33498f9a8a8d1dc |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
28d33b5e44e72edcc66a5da7a34a42147f38d987 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c343d968621d0e450e7bc28a69067fd7a78fd679 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
719133476276d857cdcebbb65031b6822f6430f3 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
443864fe5b85adae4b2123364d202918d2702636 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aa9c9b02b41e8e231648c2bbe7c4dd9a05957e73 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1cccb1582abf13bacc1508e4b79273fdda0d8ea7 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7e7e979531ff207ad205fdb5ea6ff33ef616d793 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f70708cbdf3b6caca181e2e5062b7fecbc81a40f |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
476ab849b429b28f87bbce9023c09cc26031e448 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
818c9e60452cc16963bedf66bdb1c33d2ab01c75 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5458db127655d66e5d8886724b8aeb99da84e621 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12d55dac5dd58bf5d36a0633f5a70eb54d525df0 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cb79ebfd3879a15b117619c674404573a9437cd3 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
efb0a875d15a58035ce7fa483b15f9a8deb6ec79 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c8d27935b17351ee0636bb1ea34c1902d4da8041 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ec48f8c323e7021249e9803a2a821cb5e2b28399 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
51e27a3644618134c6524bbedc18ffd8b120ac95 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
77129b009fc71779e0a07cf804da11b3025a9f45 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
e8cbf7a1ddf7263c2c0d43a7d18250912d5bd869 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d9fd22d61a148e597b5beb4e17a88660c39bcf5b |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
62dc45994535e75540278c8cc42099ddc21c2b2c |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b291683bc0f30cddc4161070757135c7b4e4569d |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
818c9e60452cc16963bedf66bdb1c33d2ab01c75 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
818c9e60452cc16963bedf66bdb1c33d2ab01c75 |
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.
I am not sure we will want to expose this token filter as it will introduce confusion as to whether this one should be used or the regular shingle filter. Let's keep this discussion to a follow-up and only tell the test to ignore this one for now? In my opinion it would remain an impl detail of the phrase query optimization for text fields.
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.
++ I realized afterward that we can just whitelist the missing factory.