O'Reilly logo

Apache Solr Beginner's Guide by Alfredo Serafini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – using Bean Scripting Framework and JavaScript

At this point, it should be clear that it's simple to index data with the Java API (we simply have to call the methods .add() and .addBean() on a server instance), thereby making querying flexible, and we can use some different wrappers of a SolrServer instance that are functionally equivalent.

This is not the end of the story, however, as it's possible to use the SolrJ library's APIs in JavaScript by using the Bean Scripting Framework (BSF), which is an Apache library designed to integrate scripting languages' code into a Java application. Note that there are other languages supported by BSF, such as Groovy or Clojure, and the same approach used here with JavaScript can be adopted ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required