Skip to content

Commit

Permalink
Merge branch 'master-upstream'
Browse files Browse the repository at this point in the history
# By Shay Banon (43) and others
# Via Shay Banon
* master-upstream: (97 commits)
  better comment...
  if multicast socket closes, try and restart it also, throttle on socket failures, so it won't spin out of control... relates to elastic#2783
  multicastSocket should be volatile as well...
  broadcast API to by default ignore missing / illegal shard state this happens for example because we list assigned shards, and they might not have been allocated on the relevant node yet, no need to list those as actual failures in some APIs
  upgrade to guava 14.0.1
  tar.gz distro by mistake include a windows lib
  fix javadoc
  Correct filter strategy opt: random_access_random to random_access_always
  Field Data: optimize long type to use narrowest possible type automatically closes elastic#2795
  make ES compile with java 8 - that isAnnotationPresent bug is known, and probably will be fixed in later versions, but it costs us nothing to not use it now - some tests fail, mainly due to consistent ordering expected from Map (within versions) which does not seem to be preserved, need to fix those tests to be agnostic to it
  use ImmutableList.Builder instead of ArrayList
  fix logging message to include the index also add the list of current indices
  Mapping: dynamic flag is explicitly returned even when not set fixes elastic#2789
  Fix bug in RateLimiter.SimpleRateLimiter causing numeric overflow in StoreStats
  improve TODO comment
  add CamelCase support to Suggester where missing
  Remove `sort_order` and `sort_mode` in favor of `order` and `mode`
  Add `sort_oder` and `sortOrder` as valid field names for defining the sort order in a Sort object.
  Make StupidBackoff the default smoothing model for phrase suggester
  minor cleanup suggest api - make sure we close the parser - fail when no content is provided in the rest request - reuse the suggest parse element
  ...
  • Loading branch information
pdegeus committed Mar 20, 2013
2 parents 9623a0a + 54e7e30 commit 27bcf2f
Show file tree
Hide file tree
Showing 317 changed files with 11,146 additions and 5,060 deletions.
4 changes: 2 additions & 2 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ h1. License
<pre>
This software is licensed under the Apache 2 license, quoted below.

Copyright 2009-2012 Shay Banon and ElasticSearch <http://www.elasticsearch.org>
Copyright 2009-2013 Shay Banon and ElasticSearch <http://www.elasticsearch.org>

Licensed 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
Expand All @@ -220,4 +220,4 @@ 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.
</pre>
</pre>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</parent>

<properties>
<lucene.version>4.1.0</lucene.version>
<lucene.version>4.2.0</lucene.version>
</properties>

<repositories>
Expand Down Expand Up @@ -143,7 +143,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0</version>
<version>14.0.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
1 change: 1 addition & 0 deletions src/main/assemblies/targz-bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<outputDirectory>lib/sigar</outputDirectory>
<excludes>
<exclude>*.dll</exclude>
<exclude>**winnt**</exclude>
</excludes>
</fileSet>
</fileSets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Licensed to ElasticSearch and Shay Banon 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.apache.lucene.analysis.miscellaneous;

import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.KeywordAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;

import java.io.IOException;


/**
* This TokenFilter emits each incoming token twice once as keyword and once non-keyword, in other words once with
* {@link KeywordAttribute#setKeyword(boolean)} set to <code>true</code> and once set to <code>false</code>.
* This is useful if used with a stem filter that respects the {@link KeywordAttribute} to index the stemmed and the
* un-stemmed version of a term into the same field.
*/
//LUCENE MONITOR - this will be included in Lucene 4.3. (it's a plain copy of the lucene version)

public final class KeywordRepeatFilter extends TokenFilter {
private final KeywordAttribute keywordAttribute = addAttribute(KeywordAttribute.class);
private final PositionIncrementAttribute posIncAttr = addAttribute(PositionIncrementAttribute.class);
private State state;

/**
* Construct a token stream filtering the given input.
*/
public KeywordRepeatFilter(TokenStream input) {
super(input);
}

@Override
public boolean incrementToken() throws IOException {
if (state != null) {
restoreState(state);
posIncAttr.setPositionIncrement(0);
keywordAttribute.setKeyword(false);
state = null;
return true;
}
if (input.incrementToken()) {
state = captureState();
keywordAttribute.setKeyword(true);
return true;
}
return false;
}

@Override
public void reset() throws IOException {
super.reset();
state = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* <tt>minimumNumberShouldMatch</tt> specification that uses the actual num of high frequent terms
* to calculate the minimum matching terms.
*/
public class ExtendedCommonTermsQuery extends XCommonTermsQuery {
public class ExtendedCommonTermsQuery extends CommonTermsQuery {

public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, boolean disableCoord) {
super(highFreqOccur, lowFreqOccur, maxTermFrequency, disableCoord);
Expand All @@ -38,7 +38,7 @@ public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float m
private String minNumShouldMatchSpec;

@Override
protected int getMinimumNumberShouldMatch(int numOptional) {
protected int calcLowFreqMinimumNumberShouldMatch(int numOptional) {
if (minNumShouldMatchSpec == null) {
return 0;
}
Expand Down
Loading

0 comments on commit 27bcf2f

Please sign in to comment.