You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello,
I was having problem with the filter StopFilter using enable_position_increments token = false; When I did a search the result was not even setting enable_position_increments = false in the query.
Began to look at the code of the elastic i saw some problem with enable_position_increments in object StopFilter on the class StopTokenFilterFactory. So I changed it by adding the following line:
public class StopTokenFilterFactory extends AbstractTokenFilterFactory {
private final Set<?> stopWords;
private final boolean ignoreCase;
NEW LINE **** private final boolean enablePositionIncrements;
@Inject public StopTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name, settings);
this.stopWords = Analysis.parseStopWords(env, settings, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
this.ignoreCase = settings.getAsBoolean("ignore_case", false);
NEW LINE **** this.enablePositionIncrements = settings.getAsBoolean("enable_position_increments", true);
}
@Override public TokenStream create(TokenStream tokenStream) {
NEW LINE **** StopFilter stopFilter = new StopFilter(version, tokenStream, stopWords, ignoreCase);
NEW LINE **** stopFilter.setEnablePositionIncrements(enablePositionIncrements);
return stopFilter;
}
public Set<?> stopWords() {
return stopWords;
}
public boolean ignoreCase() {
return ignoreCase;
}
}
The text was updated successfully, but these errors were encountered:
hello,
I was having problem with the filter StopFilter using enable_position_increments token = false; When I did a search the result was not even setting enable_position_increments = false in the query.
Began to look at the code of the elastic i saw some problem with enable_position_increments in object StopFilter on the class StopTokenFilterFactory. So I changed it by adding the following line:
public class StopTokenFilterFactory extends AbstractTokenFilterFactory {
NEW LINE **** private final boolean enablePositionIncrements;
}
The text was updated successfully, but these errors were encountered: