lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r1649525 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/example/ solr/example/films/README.txt
Date Mon, 05 Jan 2015 13:47:19 GMT
Author: ehatcher
Date: Mon Jan  5 13:47:19 2015
New Revision: 1649525

URL: http://svn.apache.org/r1649525
Log:
SOLR-6127: README improvements (merged from trunk r1649523)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/example/   (props changed)
    lucene/dev/branches/branch_5x/solr/example/films/README.txt

Modified: lucene/dev/branches/branch_5x/solr/example/films/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/example/films/README.txt?rev=1649525&r1=1649524&r2=1649525&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/example/films/README.txt (original)
+++ lucene/dev/branches/branch_5x/solr/example/films/README.txt Mon Jan  5 13:47:19 2015
@@ -17,22 +17,10 @@ This data consists of the following fiel
    * 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",
         "stored":true
@@ -48,19 +36,43 @@ curl http://localhost:8983/solr/films/sc
 
      - 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



Mime
View raw message