Skip to content

Apache Lucene open-source search software

SOLR-6127: README improvements

Erik Hatcher749d0ccff08f
diff --git a/solr/example/films/README.txt b/solr/example/films/README.txt
index 9fc2a69fc7b..a4751e376f5 100644
--- a/solr/example/films/README.txt
+++ b/solr/example/films/README.txt
@@ -17,21 +17,9 @@ This data consists of the following fields -
* Create a "films" core
bin/solr create_core -n films -c data_driven_schema_configs
- * Update the schema (by default it will guess the field types based on the date as it is indexed):
+ * Set the schema on a couple of fields that Solr would otherwise guess differently about:
curl http://localhost:8983/solr/films/schema/fields -X POST -H 'Content-type:application/json' --data-binary '
[
- {
- "name":"genre",
- "type":"string",
- "stored":true,
- "multiValued":true
- },
- {
- "name":"directed_by",
- "type":"string",
- "stored":true,
- "multiValued":true
- },
{
"name":"name",
"type":"text_general",
@@ -48,19 +36,43 @@ curl http://localhost:8983/solr/films/schema/fields -X POST -H 'Content-type:app
- JSON: bin/post films example/films/films.json
- XML: bin/post films example/films/films.xml
- - CSV: bin/post films example/films/films.csv params=f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=|
+ - CSV: bin/post films example/films/films.csv "params=f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=|"
* Let's get searching.
- Search for 'Batman':
http://localhost:8983/solr/films/query?q=name:batman
+ * If you get an error about the name field not existing, you haven't yet indexed the data
+ * If you don't get an error, but zero results, chances are that the _name_ field schema type override wasn't set
+ before indexing the data the first time. It's easiest to simply reset the environment and try again, ensuring
+ that each step successfully executes.
+
- Show me all 'Super hero' movies:
http://localhost:8983/solr/films/query?q=*:*&fq=genre:%22Superhero%20movie%22
- Let's see the distribution of genres across all the movies. See the facet section for the counts:
http://localhost:8983/solr/films/query?q=*:*&facet=true&facet.field=genre
+ - Browse the indexed films in a traditional browser search interface:
+ http://localhost:8983/solr/films/browse
+
+ Now browse including the genre field as a facet:
+ http://localhost:8983/solr/films/browse?facet.field=genre
+
Exploring the data further -
* Increase the MAX_ITERATIONS value, put in your freebase API_KEY and run the film_data_generator.py script using Python 3.
- Now re-index Solr with the new data.
\ No newline at end of file
+ Now re-index Solr with the new data.
+
+FAQ:
+ Why override the schema of the _name_ and _initial_release_date_ fields?
+
+ Without overriding those field types, the _name_ field would have been guessed as a multi-valued string field type
+ and _initial_release_date_ would have been guessed as a multi-valued tdate type. It makes more sense in our application
+ to have the movie name be a single valued general full-text searchable field, and for the release date also to be single valued.
+
+ How do I clear and reset my environment?
+
+ bin/solr stop
+ rm -Rf server/solr/films/
+ # then start from the beginning of the instructions to start fresh
\ No newline at end of file