Skip to content

Commit

Permalink
Merge pull request #4 from sul-dlss/solr8
Browse files Browse the repository at this point in the history
Update to support solr 8
  • Loading branch information
mejackreed authored Jul 13, 2020
2 parents dc2fa85 + eb33552 commit 3c8a6a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: java
script:
- mvn clean install
jdk:
- oraclejdk8
- oraclejdk9
- openjdk11
after_success:
- bash <(curl -s https://codecov.io/bash)
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<groupId>edu.stanford</groupId>
<artifactId>tokenizing-suggest</artifactId>
<version>v1.0.1</version>
<version>v2.0</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<version.solr>7.7.0</version.solr>
<version.mvn-jacoco>0.8.1</version.mvn-jacoco>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<version.solr>8.5.2</version.solr>
<version.mvn-jacoco>0.8.5</version.mvn-jacoco>
<version.io>2.5</version.io>
<resources.plugin.version>2.7</resources.plugin.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ protected TokenStreamComponents wrapComponents(String fieldName, TokenStreamComp
: "no need \"textgrams\" when minPrefixChars="+minPrefixChars;
if (fieldName.equals(TEXTGRAMS_FIELD_NAME) && minPrefixChars > 0) {
// TODO: should use an EdgeNGramTokenFilterFactory here
TokenFilter filter = new EdgeNGramTokenFilter(components.getTokenStream(), 1, minPrefixChars);
return new TokenStreamComponents(components.getTokenizer(), filter);
TokenFilter filter = new EdgeNGramTokenFilter(components.getTokenStream(), 1, minPrefixChars, false);
return new TokenStreamComponents(components.getSource(), filter);
} else {
return components;
}
Expand Down Expand Up @@ -674,7 +674,7 @@ public List<LookupResult> lookup(CharSequence key, BooleanQuery contextQuery, in
//System.out.println("finalQuery=" + finalQuery);

// Sort by weight, descending:
TopFieldCollector c = TopFieldCollector.create(SORT, num, true, false, false, false);
TopFieldCollector c = TopFieldCollector.create(SORT, num, 1);
List<LookupResult> results = null;
SearcherManager mgr;
IndexSearcher searcher;
Expand Down Expand Up @@ -717,7 +717,7 @@ protected List<LookupResult> createResults(IndexSearcher searcher, TopGroups<Obj
ScoreDoc fd = hits.groups[i].scoreDocs[0];
BytesRef term = (BytesRef) hits.groups[i].groupValue;
String text = term.utf8ToString();
long score = hits.groups[i].totalHits;
long score = hits.groups[i].totalHits.value;

// This will just be null if app didn't pass payloads to build():
// TODO: maybe just stored fields? they compress...
Expand Down

0 comments on commit 3c8a6a3

Please sign in to comment.