Solr exercise meant to develop Lucene text analysis knowledge + lightly touching on Solr update processors.
- Clone this git repository onto your local workstation
cd
into the project directory- View the available gradle tasks via
./gradlew
for Mac/Linux orgradlew.bat
for windows - Setup eclipse via
./gradlew eclipse
or IntelliJ via./gradlew idea
- Those too cool for IDEs can skip to step 6 and run tests via
./gradlew test
- Import the project into your IDE
- Run the tests and see what breaks!
- Note: If you see an error saying something about "-ea" go to Eclipse preferences -> Java -> JUnit -> Select "add '-ea' to VM Arguments" checkbox
- Use your new found knowledge of text analysis to solve the majority of the test fails.
- The Solr schema is where you will find the field definitions along with the associated analysis chains found at
src/test/resources/solr-conf/gt/conf/schema.xml
- The Solr schema is where you will find the field definitions along with the associated analysis chains found at
- There is one challenge that will involve creating a custom update processor to combine the
latitude
andlongitude
fields into a finallat-lon
field in the format of<latitude value>,<longitude value>
- The update processor is defined in the SolrConfig file located at
src/test/resources/solr-conf/gt/conf/solrconfig.xml
. For an example custom processor see an example written in either Javascript (src/test/resources/solr-conf/gt/conf/base64-decoder.js
) or Java (src/main/java/..../Base64DecodingUpdateProcessorFactory.java
)
- The update processor is defined in the SolrConfig file located at
- If you created a custom Java update processor run the
./gradlew jar
task. - Unzip the Solr directory
- Open a new command prompt and
cd
into the Solr directory - Start Solr via
bin/solr -f -s <path-to-solr-exercise-workspace-dir>/src/test/resources/solr-conf/
- Download the sample data via
./gradlew downloadExampleData
task in the exercise directory - Copy and run the url that was emitted from the download task
- If all went well, you indexed the data! You can access the admin page at
http://localhost:8983/solr/#/gt