Once data has been properly indexed, it's definitely time to search! The indexing phase makes no sense if things end there. Data is indexed mainly to speed up and facilitate searches.
This chapter focuses on search capabilities offered by Solr and illustrates the several components that contribute to its read path.
The chapter will cover the following topics:
Throughout this chapter, we will use a sample Solr instance with a configuration that includes all the topics we will gradually describe. This instance will have a set of simple documents representing music albums. These are the first three documents:
<doc> <field name="id">1</field> <field name="title">A Modern Jazz Symposium of Music and Poetry</field> <field name="composer">Charles Mingus</field> … </doc> <doc> <field name="id">2</field> <field name="title">Where Jazz meets Poetry</field> <field name="artist">Raphael Austin</field> … </doc> <doc> <field name="id">3</field> <field name="title">I'm In The Mood For Love</field> <field name="composer">Charlie Parker</field> <field name="genre">Jazz</field> … </doc>
The source code of the sample project associated with this chapter contains the entire Maven project, which can be either loaded in Eclipse or used via the command line. As a preliminary step, open a shell (or run the following command within Eclipse) in the project folder and type this:
# mvn clean cargo:run –P querying
The preceding command will start a new Solr instance, with sample data preloaded.
You can use the page located at http://127.0.0.1:8983/solr/#/example/query
to try and experiment by yourself the several things we will discuss.
18.217.107.229