Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SolrTextTagger not working with EmbeddedSolr 6.2.1 #69

Closed
lujea opened this issue Jul 25, 2017 · 2 comments
Closed

SolrTextTagger not working with EmbeddedSolr 6.2.1 #69

lujea opened this issue Jul 25, 2017 · 2 comments

Comments

@lujea
Copy link

lujea commented Jul 25, 2017

Hi,
I am trying to use SolrTextTagger with EmbeddedSolr 6.2.1. I have configured the index schema in the same way as suggested in the example (add the request handler, copy fields, etc.).

Here is the code I am trying to execute:

public void tagDocument(String text) {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("field", "name_tag");
QueryRequest request = new SolrTaggerRequest(params, text);
request.setPath("/tag");

    try {
        QueryResponse response = request.process(getSolrClient());
        for (SolrDocument doc: response.getResults()){
            logger.info("title: {}, name_tag: {}", doc.get("title"), doc.get("name_tag"));
        }

    } catch (SolrServerException ex) {
        logger.error("SolrServerException: fail to execute term query", ex);
    } catch (IOException ex) {
        logger.error("IOException: fail to execute term query", ex);
    }
}

When I execute the code I have this error:
java.lang.NoSuchMethodError: org.apache.solr.search.SolrIndexSearcher.getSlowAtomicReader()Lorg/apache/lucene/index/LeafReader;
at org.opensextant.solrtexttagger.TaggerRequestHandler.handleRequestBody(TaggerRequestHandler.java:167)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:154)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2089)
at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:178)
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:149)
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:166)
at com.engine.artes.resources.SolrTextTagger.tagDocument(SolrTextTagger.java:83)

Can you please help me fix the problem ?

@dsmiley
Copy link
Member

dsmiley commented Jul 25, 2017

Hi,
I believe this is a simple issue of using the wrong SolrTextTagger release. You should use v2.3. See https://github.com/OpenSextant/SolrTextTagger/blob/master/CHANGES.md

@dsmiley dsmiley closed this as completed Jul 25, 2017
@lujea
Copy link
Author

lujea commented Jul 25, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants