concept xml in category solr

appears as: XML, xml, XML
Solr in Action

This is an excerpt from Manning's book Solr in Action.

At this point, we know that Lucene provides a powerful library for indexing documents, executing queries, and ranking results. And, with schema.xml, you have a flexible way to define the index structure using an XML-configuration document instead of having to program to the Lucene API. Now you need a way to access these services from the web. In the next section, we learn how Solr runs as a Java web application and integrates with other technologies, using proven standards such as XML, JSON, and HTTP.

Beyond XML, Solr’s update request handler also supports the popular JSON and CSV data formats. Instead of indexing our example tweets using XML, we could have used JSON as shown in this listing.

Listing 5.14. Using JSON to index documents instead of XML

We’ll use the post.jar utility to send the JSON to Solr, but because XML is the default type, we have to explicitly tell the application that we’re sending JSON by setting the type system property to application/json:

/select?wt=xml&indent=true&q=*:*&fl=id,title&rows=2
!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":11},{\"line\":0,\"ch\":14}]]"}
!@%STYLE%@!