Run the Wikipedia demo with SearchAnalytics

The following instructions describe how to use search queries in the Spark console on SearchAnalytics nodes using the Wikipedia demo.

  1. Create a SearchAnalytics datacenter as described in Initialize a single datacenter per workload type, and start a node in SearchAnalytics mode.

  2. Ensure that the cluster is running correctly by running dsetool ring. The node type should be SearchAnalytics.

    Package installations: dsetool ring

    Tarball installations: installation_location/bin/dsetool ring

  3. In a terminal, change to the /demos/wikipedia directory in your DSE installation:

    The default location of the demos directory depends on the type of installation:

    README.md files are provided with your DSE installation and in the demos directories with instructions on building and running the demo applications.

  4. Add the schema by running the 1-add-schema.sh script.

    ./1-add-schema.sh
  5. Create the search indexes.

    ./2-index.sh
  6. Start the Spark console:

    dse spark
  7. Create an RDD based on the wiki.solr table.

    val table = sc.cassandraTable("wiki","solr")
    table: com.datastax.spark.connector.rdd.CassandraTableScanRDD[com.datastax.spark.connector.CassandraRow] = CassandraTableScanRDD[0] at RDD at CassandraRDD.scala:15
  8. Run a query using the title Solr index and collect the results.

    val result = table.select("id","title").where("solr_query='title:Boroph*'").collect

    Equivalent JSON query:

    where("solr_query='{"q": "title:Boroph*"}'")
    result:
        Array[com.datastax.spark.connector.CassandraRow] = Array(
            CassandraRow{id: 23729958, title: Borophagus parvus},
            CassandraRow{id: 23730195, title: Borophagus dudleyi},
            CassandraRow{id: 23730528, title: Borophagus hilli},
            CassandraRow{id: 23730810, title: Borophagus diversidens},
            CassandraRow{id: 23730974, title: Borophagus littoralis},
            CassandraRow{id: 23731282, title: Borophagus orc},
            CassandraRow{id: 23731616, title: Borophagus pugnator},
            CassandraRow{id: 23732450, title: Borophagus secundus})

For details on using search query syntax in CQL, see CQL queries.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM