Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['11']
# Solr 10 requires Java 21 or later.
java-version: ['21']

env:
# Until the Solr 10 upgrade is merged into vufind-org/vufind's dev branch,
# build and test against the corresponding pull request branch.
VUFIND_GIT_URL: https://github.com/stweil/vufind.git
VUFIND_BRANCH: update_solr_10

steps:
- name: Setup PHP
Expand Down Expand Up @@ -41,9 +48,10 @@ jobs:

- name: Download and Setup VuFind
run: |
if [ ! -d $VUFIND_HOME/.git ]; then git clone https://github.com/vufind-org/vufind.git $VUFIND_HOME; fi;
if [ ! -d $VUFIND_HOME/.git ]; then git clone $VUFIND_GIT_URL $VUFIND_HOME; fi
cd $VUFIND_HOME
git pull
git fetch $VUFIND_GIT_URL $VUFIND_BRANCH
git checkout -B $VUFIND_BRANCH FETCH_HEAD
composer install

- name: Create Test Index
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- The solr.install.dir property was added to work around an issue in the Solr 9.1 test suite;
it can probably be safely removed once VuFind upgrades to Solr 9.2 or higher. -->
<property name="solr.install.dir" value="${absolute.vufind.dir}/solr/vendor"/>
<property name="java.compat.version" value="11"/>
<property name="java.compat.version" value="17"/>

<path id="classpath">
<pathelement location="${builddir}"/>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/vufind/solr/handler/AuthDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Document getAuthorityRecord(String heading)
heading)),
1));

if (results.totalHits.value > 0) {
if (results.totalHits.value() > 0) {
return searcher.getIndexReader().storedFields().document(results.scoreDocs[0].doc);
} else {
return null;
Expand All @@ -79,7 +79,7 @@ public List<Document> getPreferredHeadings(String heading)
List<Document> result = new ArrayList<> ();

StoredFields storedFields = searcher.getIndexReader().storedFields();
for (int i = 0; i < results.totalHits.value; i++) {
for (int i = 0; i < results.totalHits.value(); i++) {
result.add(storedFields.document(results.scoreDocs[i].doc));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.vufind.solr.handler.client.solrj;

import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrRequest.SolrRequestType;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;

/**
* Client class for sending queries to {@link BrowseRequestHandler}.
Expand All @@ -26,25 +27,26 @@ public class BrowseRequest extends SolrRequest<BrowseResponse>

public BrowseRequest()
{
super(METHOD.GET, path);
super(METHOD.GET, path, SolrRequestType.QUERY);
}

public BrowseRequest(SolrParams q)
{
super(METHOD.GET, path);
super(METHOD.GET, path, SolrRequestType.QUERY);
query = q;
}


public BrowseRequest(METHOD m, String path)
{
super(m, path);
super(m, path, SolrRequestType.QUERY);
// TODO Auto-generated constructor stub
}

public String getRequestType()
@Override
public SolrRequestType getRequestType()
{
return "VuFindBrowseRequest";
return SolrRequestType.QUERY;
}

@Override
Expand All @@ -54,9 +56,9 @@ public SolrParams getParams()
}

@Override
protected BrowseResponse createResponse(SolrClient client)
protected BrowseResponse createResponse(NamedList<Object> res)
{
return new BrowseResponse(client);
return new BrowseResponse(res);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ static protected Map<String,Object> castToMapOfStringObject(Object o)
return (Map<String,Object>) o;
}

/**
* Utility constructor to set the namedList
*/
public BrowseResponse(NamedList<Object> res)
{
this(res, null);
}

/**
* Utility constructor to set the solrServer and namedList
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private boolean termExists(String t)
{
try {
return (this.searcher.search(new ConstantScoreQuery(new TermQuery(new Term(this.field, t))),
1).totalHits.value > 0);
1).totalHits.value() > 0);
} catch (IOException e) {
return false;
}
Expand Down
Loading