<commit_before># DataStax XML Demo

This application demonstrates how to store searchable XML documents in DataStax Enterprise.

## Configure the Cluster

### Contact Points

To specify contact points use the `contactPoints` command line parameter. The value may contact multiple IPs in the format `IP,IP,IP`, without spaces. `-DcontactPoints=192.168.25.100,192.168.25.101`.

### Schema

To create the schema, run:

	mvn clean compile exec:java -Dexec.mainClass=com.datastax.demo.schema.SchemaSetup -DcontactPoints=localhost
	
To remove the schema, run:

	mvn clean compile exec:java -Dexec.mainClass=com.datastax.demo.schema.SchemaTeardown -DcontactPoints=localhost

### Solr Core

TODO To create the solr core, run:

	dsetool create_core datastax_xml_demo.movies reindex=true coreOptions=solr/rt.yaml schema=solr/movies_schema.xml solrconfig=solr/movies_solrconfig.xml

## Populate Sample Data

Thank you to the Department of Computer Sciences at the University of Wisconsin-Madison for the [XML movie data][niagara].

### Bulk Load

To bulk load the database with sample data, run:

	mvn clean compile exec:java -Dexec.mainClass="com.datastax.demo.xml.sampledata.BulkDataLoader" -DcontactPoints=localhost

### Web Service & Streaming Updates

Coming soon...

## Web Services

### Launch the Web Server

To start the web server, in another terminal run:

	mvn jetty:run

### Query Via the Web API

To retrieve a specific movie, use the following REST command:

	http://localhost:8080/datastax-xml-demo/rest/movie/{title}/{year}
	
	Example: http://localhost:8080/datastax-xml-demo/rest/movie/Network/1976
	
To search by genre, use the following REST command:

	http://localhost:8080/datastax-xml-demo/rest/search/genre/{genre}
	
	Example: http://localhost:8080/datastax-xml-demo/rest/search/genre/drama
	
[niagara]: http://research.cs.wisc.edu/niagara/data.html "Niagara XML movie data"<commit_msg>Update README for search by director.<commit_after># DataStax XML Demo

This application demonstrates how to store searchable XML documents in DataStax Enterprise.

## Configure the Cluster

### Contact Points

To specify contact points use the `contactPoints` command line parameter. The value may contact multiple IPs in the format `IP,IP,IP`, without spaces. `-DcontactPoints=192.168.25.100,192.168.25.101`.

### Schema

To create the schema, run:

	mvn clean compile exec:java -Dexec.mainClass=com.datastax.demo.schema.SchemaSetup -DcontactPoints=localhost
	
To remove the schema, run:

	mvn clean compile exec:java -Dexec.mainClass=com.datastax.demo.schema.SchemaTeardown -DcontactPoints=localhost

### Solr Core

TODO To create the solr core, run:

	dsetool create_core datastax_xml_demo.movies reindex=true coreOptions=solr/rt.yaml schema=solr/movies_schema.xml solrconfig=solr/movies_solrconfig.xml

## Populate Sample Data

Thank you to the Department of Computer Sciences at the University of Wisconsin-Madison for the [XML movie data][niagara].

### Bulk Load

To bulk load the database with sample data, run:

	mvn clean compile exec:java -Dexec.mainClass="com.datastax.demo.xml.sampledata.BulkDataLoader" -DcontactPoints=localhost

### Web Service & Streaming Updates

Coming soon...

## Web Services

### Launch the Web Server

To start the web server, in another terminal run:

	mvn jetty:run

### Query Via the Web API

To retrieve a specific movie, use the following REST command:

	http://localhost:8080/datastax-xml-demo/rest/movie/{title}/{year}
	
	Example: http://localhost:8080/datastax-xml-demo/rest/movie/Network/1976
	
To search by genre, use the following REST command:

	http://localhost:8080/datastax-xml-demo/rest/search/genre/{genre}
	
	Example: http://localhost:8080/datastax-xml-demo/rest/search/genre/drama
	
To search by director, use the following REST command:

	http://localhost:8080/datastax-xml-demo/rest/search/director/{director}
	
	Example: http://localhost:8080/datastax-xml-demo/rest/search/director/%22James%20Cameron%22
	
[niagara]: http://research.cs.wisc.edu/niagara/data.html "Niagara XML movie data"
{'fraction_non_alphanumeric': 0.10054347826086957, 'fraction_numerical': 0.024209486166007904, 'mean_word_length': 4.851156069364162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1611053', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1240, 'n_words': 376}