Skip to content

Commit

Permalink
Lucene 8 (#71)
Browse files Browse the repository at this point in the history
* upgrade lucene 8.0

* clean up
  • Loading branch information
javasoze authored Sep 2, 2019
1 parent 5819ec3 commit 6a55efe
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
4 changes: 2 additions & 2 deletions bin/build_sample_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

lib=$bin/../target/lib
lib=$bin/../target/libs
dist=$bin/../target

HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
JAVA_OPTS=""

MAIN_CLASS="io.dashbase.clue.test.BuildSampleIndex"

java $JAVA_OPTS $JMX_OPTS $HEAP_OPTS -cp $dist/clue-*.jar $MAIN_CLASS $bin/../src/main/resources/cars.json $@
java $JAVA_OPTS $JMX_OPTS $HEAP_OPTS -cp $dist/*:$lib/* $MAIN_CLASS $bin/../src/main/resources/cars.json $@
4 changes: 2 additions & 2 deletions bin/clue-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

lib=$bin/../target/lib
lib=$bin/../target/libs
dist=$bin/../target

HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
#JAVA_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y"

(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -cp $dist/clue-*.jar io.dashbase.clue.client.ClueCommandClient $@)
(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -cp $dist/*:$lib/* io.dashbase.clue.client.ClueCommandClient $@)
4 changes: 2 additions & 2 deletions bin/clue-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

lib=$bin/../target/lib
lib=$bin/../target/libs
dist=$bin/../target

HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
#JAVA_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y"

(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -cp $dist/clue-*.jar io.dashbase.clue.server.ClueWebApplication server config/clue-web.yml)
(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -cp $dist/*:$lib/* io.dashbase.clue.server.ClueWebApplication server config/clue-web.yml)
5 changes: 3 additions & 2 deletions bin/clue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

lib=$bin/../target/lib
lib=$bin/../target/libs
dist=$bin/../target

HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
#JAVA_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y"

(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -jar $dist/clue-*.jar $@)
MAIN_CLASS="io.dashbase.clue.ClueApplication"
(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -classpath $dist/*:$lib/* $MAIN_CLASS $@)
24 changes: 22 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>clue</artifactId>
<packaging>jar</packaging>
<name>clue</name>
<version>7.6.0-2.0.0</version>
<version>8.2.0-1.0.0</version>
<description>command line client for Apache Lucene</description>

<url>http://github.com/javasoze/clue</url>
Expand Down Expand Up @@ -36,7 +36,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>io.dashbase.clue.ClueApplication</mainClass>
<lucene.version>7.6.0</lucene.version>
<lucene.version>8.2.0</lucene.version>
<dropwizard.version>1.3.5</dropwizard.version>
<retrofit2.version>2.5.0</retrofit2.version>
</properties>
Expand All @@ -53,6 +53,26 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<!--
<plugin>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/dashbase/clue/util/MatchSomeDocsQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public String toString(String s) {
}

@Override
public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException {
return new ConstantScoreWeight(this, 1.0f) {
@Override
public Scorer scorer(LeafReaderContext leafReaderContext) throws IOException {

return new ConstantScoreScorer(this, score(), docIdSetIterator);
return new ConstantScoreScorer(this, score(), scoreMode, docIdSetIterator);
}

@Override
Expand Down

0 comments on commit 6a55efe

Please sign in to comment.