129118
129118
com
https://ebookmeta.com/product/elasticsearch-server-third-
edition-rafal-kuc/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/elasticsearch-server-third-edition-
rafal-kuc/
ebookmeta.com
https://ebookmeta.com/product/elasticsearch-in-action-second-edition-
meap-v13-madhusudhan-konda/
ebookmeta.com
https://ebookmeta.com/product/fun-and-games-field-day-understanding-
length-chryste-l-berda/
ebookmeta.com
Breaking Dawn (Delta Force Strong Book 8) 1st Edition Elle
James
https://ebookmeta.com/product/breaking-dawn-delta-force-strong-
book-8-1st-edition-elle-james/
ebookmeta.com
https://ebookmeta.com/product/purrfect-advice-the-mysteries-of-max-
book-22-1st-edition-nic-saint-saint-nic/
ebookmeta.com
https://ebookmeta.com/product/routledge-handbook-of-afro-latin-
american-studies-1st-edition-edited-by-bernd-reiter-john-anton-
sanchez/
ebookmeta.com
https://ebookmeta.com/product/silencing-a-whistleblower-a-story-of-
hypocrisy-1st-edition-cobus-de-swardt/
ebookmeta.com
https://ebookmeta.com/product/the-rough-guide-to-fiji-3rd-edition-
rough-guides-ian-osborn-martin-zatko/
ebookmeta.com
Norton s Obsession Hughes Stalker Duet 1 1st Edition Mia
Fury
https://ebookmeta.com/product/norton-s-obsession-hughes-stalker-
duet-1-1st-edition-mia-fury/
ebookmeta.com
www.EBooksWorld.ir
www.EBooksWorld.ir
Elasticsearch Server Third Edition
www.EBooksWorld.ir
Table of Contents
Elasticsearch Server Third Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Elasticsearch Cluster
Full text searching
The Lucene glossary and architecture
Input data analysis
Indexing and querying
Scoring and query relevance
The basics of Elasticsearch
Key concepts of Elasticsearch
Index
Document
www.EBooksWorld.ir
Document type
Mapping
Key concepts of the Elasticsearch infrastructure
Nodes and clusters
Shards
Replicas
Gateway
Indexing and searching
Installing and configuring your cluster
Installing Java
Installing Elasticsearch
Running Elasticsearch
Shutting down Elasticsearch
The directory layout
Configuring Elasticsearch
The system-specific installation and configuration
Installing Elasticsearch on Linux
Installing Elasticsearch using RPM packages
Installing Elasticsearch using the DEB package
Elasticsearch configuration file localization
Configuring Elasticsearch as a system service on Linux
Elasticsearch as a system service on Windows
Manipulating data with the REST API
Understanding the REST API
Storing data in Elasticsearch
Creating a new document
Automatic identifier creation
Retrieving documents
Updating documents
Dealing with non-existing documents
Adding partial documents
www.EBooksWorld.ir
Deleting documents
Versioning
Usage example
Versioning from external systems
Searching with the URI request query
Sample data
URI search
Elasticsearch query response
Query analysis
URI query string parameters
The query
The default search field
Analyzer
The default operator property
Query explanation
The fields returned
Sorting the results
The search timeout
The results window
Limiting per-shard results
Ignoring unavailable indices
The search type
Lowercasing term expansion
Wildcard and prefix analysis
Lucene query syntax
Summary
2. Indexing Your Data
Elasticsearch indexing
Shards and replicas
Write consistency
Creating indices
www.EBooksWorld.ir
Altering automatic index creation
Settings for a newly created index
Index deletion
Mappings configuration
Type determining mechanism
Disabling the type determining mechanism
Tuning the type determining mechanism for numeric types
Tuning the type determining mechanism for dates
Index structure mapping
Type and types definition
Fields
Core types
Common attributes
String
Number
Boolean
Binary
Date
Multi fields
The IP address type
Token count type
Using analyzers
Out-of-the-box analyzers
Defining your own analyzers
Default analyzers
Different similarity models
Setting per-field similarity
Available similarity models
Configuring default similarity
Configuring BM25 similarity
Configuring DFR similarity
www.EBooksWorld.ir
Configuring IB similarity
Batch indexing to speed up your indexing process
Preparing data for bulk indexing
Indexing the data
The _all field
The _source field
Additional internal fields
Introduction to segment merging
Segment merging
The need for segment merging
The merge policy
The merge scheduler
Throttling
Introduction to routing
Default indexing
Default searching
Routing
The routing parameters
Routing fields
Summary
3. Searching Your Data
Querying Elasticsearch
The example data
A simple query
Paging and result size
Returning the version value
Limiting the score
Choosing the fields that we want to return
Source filtering
Using the script fields
Passing parameters to the script fields
www.EBooksWorld.ir
Understanding the querying process
Query logic
Search type
Search execution preference
Search shards API
Basic queries
The term query
The terms query
The match all query
The type query
The exists query
The missing query
The common terms query
The match query
The Boolean match query
The phrase match query
The match phrase prefix query
The multi match query
The query string query
Running the query string query against multiple fields
The simple query string query
The identifiers query
The prefix query
The fuzzy query
The wildcard query
The range query
Regular expression query
The more like this query
Compound queries
The bool query
The dis_max query
www.EBooksWorld.ir
The boosting query
The constant_score query
The indices query
Using span queries
A span
Span term query
Span first query
Span near query
Span or query
Span not query
Span within query
Span containing query
Span multi query
Performance considerations
Choosing the right query
The use cases
Limiting results to given tags
Searching for values in a range
Boosting some of the matched documents
Ignoring lower scoring partial queries
Using Lucene query syntax in queries
Handling user queries without errors
Autocomplete using prefixes
Finding terms similar to a given one
Matching phrases
Spans, spans everywhere
Summary
4. Extending Your Querying Knowledge
Filtering your results
The context is the key
Explicit filtering with bool query
www.EBooksWorld.ir
Highlighting
Getting started with highlighting
Field configuration
Under the hood
Forcing highlighter type
Configuring HTML tags
Controlling highlighted fragments
Global and local settings
Require matching
Custom highlighting query
The Postings highlighter
Validating your queries
Using the Validate API
Sorting data
Default sorting
Selecting fields used for sorting
Sorting mode
Specifying behavior for missing fields
Dynamic criteria
Calculate scoring when sorting
Query rewrite
Prefix query as an example
Getting back to Apache Lucene
Query rewrite properties
Summary
5. Extending Your Index Structure
Indexing tree-like structures
Data structure
Analysis
Indexing data that is not flat
Data
www.EBooksWorld.ir
Objects
Arrays
Mappings
Final mappings
Sending the mappings to Elasticsearch
To be or not to be dynamic
Disabling object indexing
Using nested objects
Scoring and nested queries
Using the parent-child relationship
Index structure and data indexing
Child mappings
Parent mappings
The parent document
Child documents
Querying
Querying data in the child documents
Querying data in the parent documents
Performance considerations
Modifying your index structure with the update API
The mappings
Adding a new field to the existing index
Modifying fields of an existing index
Summary
6. Make Your Search Better
Introduction to Apache Lucene scoring
When a document is matched
Default scoring formula
Relevancy matters
Scripting capabilities of Elasticsearch
Objects available during script execution
www.EBooksWorld.ir
Script types
In file scripts
Inline scripts
Indexed scripts
Querying with scripts
Scripting with parameters
Script languages
Using other than embedded languages
Using native code
The factory implementation
Implementing the native script
The plugin definition
Installing the plugin
Running the script
Searching content in different languages
Handling languages differently
Handling multiple languages
Detecting the language of the document
Sample document
The mappings
Querying
Queries with an identified language
Queries with an unknown language
Combining queries
Influencing scores with query boosts
The boost
Adding the boost to queries
Modifying the score
Constant score query
Boosting query
The function score query
www.EBooksWorld.ir
Structure of the function query
The weight factor function
Field value factor function
The script score function
The random score function
Decay functions
When does index-time boosting make sense?
Defining boosting in the mappings
Words with the same meaning
Synonym filter
Synonyms in the mappings
Synonyms stored on the file system
Defining synonym rules
Using Apache Solr synonyms
Explicit synonyms
Equivalent synonyms
Expanding synonyms
Using WordNet synonyms
Query or index-time synonym expansion
Understanding the explain information
Understanding field analysis
Explaining the query
Summary
7. Aggregations for Data Analysis
Aggregations
General query structure
Inside the aggregations engine
Aggregation types
Metrics aggregations
Minimum, maximum, average, and sum
Missing values
www.EBooksWorld.ir
Using scripts
Field value statistics and extended statistics
Value count
Field cardinality
Percentiles
Percentile ranks
Top hits aggregation
Additional parameters
Geo bounds aggregation
Scripted metrics aggregation
Buckets aggregations
Filter aggregation
Filters aggregation
Terms aggregation
Counts are approximate
Minimum document count
Range aggregation
Keyed buckets
Date range aggregation
IPv4 range aggregation
Missing aggregation
Histogram aggregation
Date histogram aggregation
Time zones
Geo distance aggregations
Geohash grid aggregation
Global aggregation
Significant terms aggregation
Choosing significant terms
Multiple value analysis
Sampler aggregation
www.EBooksWorld.ir
Another Random Scribd Document
with Unrelated Content
reverent restoration, and thwart all efforts at reckless innovation. Sir
Henry Maine happily assessed the worth of this truly national
safeguard in the statement that our institutions had, however
undesignedly, arrived at a state in which satisfaction and impatience,
the chief sources of political conduct, were adequately called into play.
Of this self-adjusting process Pitt, at least during the best years of his
career, was to be the sage director.
There were many reasons why Englishmen should be a prey
alternately to feelings of satisfaction and discontent. Instinct and
tradition bade them be loyal to the throne and to the institutions of
their fathers. Reason and reflection bade them censure the war policy
of George III and the means whereby he sought to carry it through to
the bitter end. St. Stephen’s, Westminster, had been the shrine of the
nation’s liberties; it now, so Burke declared, threatened them with a
slow and inglorious extinction. Obedience to the laws had ever been
the pride of the nation; but now that virtue might involve subservience
to a corrupt and greedy faction.
Yet however great the provocations, Britons were minded to right
these wrongs in their own way, and not after the fashions set at
Geneva or Paris. In truth they had one great advantage denied to
Continental reformers. At Paris reform almost necessarily implied
innovation; for, despite the dictum of Burke to the contrary, it is safe to
say that the relics of the old constitution of France offered no
adequate basis on which to reconstruct her social and political fabric.
In England the foundations and the walls were in good repair. The
structure needed merely extension, not rebuilding. Moreover, British
reformers were by nature and tradition inclined towards tentative
methods and rejected wholesale schemes. Even in the dull years of
George II the desire for a Reform of Parliament was not wholly without
expression; and now, at the time of the American War, the desire
became a demand, which nearly achieved success. In fact, the Reform
programme of 1780 satisfied the aspirations of the more moderate
men, even in the years 1791–4, when the excitements of the French
Revolution, and the writings of Thomas Paine for a time popularized
the levelling theories then in vogue at Paris.
Certainly, before the outbreak of the French Revolution, the
writings of Continental thinkers had little vogue in Great Britain. The
“Social Contract” of Rousseau was not widely known, and its most
noteworthy theses, despite the fact that they were borrowed from
Hobbes and Locke, aroused no thrill of sympathy. This curious fact
may be explained by the innate repugnance of the islanders alike to
the rigidly symmetrical form in which the Genevese prophet clothed his
dogmas, and to the Jacobins’ claim for them of universal applicability.
The very qualities which carried conviction to the ardent and logic-
loving French awakened doubts among the cooler northern folk.
Then again, however sharp might be the resentment against
George III for this or that action, national sentiment ran strongly in the
traditional channels. After the collapse of the Stuart cause loyalty to
the throne and to the dynasty was the dominant feeling among all
classes. As Burke finely said of the Tories after the accession of George
III, “they changed their idol but they preserved their idolatry.” The
personality of George III was such as to help on this transformation. A
certain bonhomie, as of an English squire, set off by charm of manner
4
and graciousness of speech, none too common in that class, went to
the hearts of all who remembered the outlandish ways of the first two
Georges. Furthermore, his morals were distinctly more reputable than
theirs, as was seen at the time of his youth, when he withstood the
wiles strewn in his path by several ladies of the Court with a frankness
5
worthy of the Restoration times. His good sense, straightforwardness,
and his love of country life and of farming endeared him both to the
masses of the people and to the more select circles which began to
learn from Versailles the cult of Rousseau and the charms of butter
making. Queen Charlotte, a princess of the House of Mecklenburg-
Strelitz, also set her face against vice and extravagance, but in a
primly austere manner which won few to the cause of virtue.
Domesticity in her ceased to be alluring. Idle tongues wagged against
her even when she sought to encourage the wearing of dresses woven
in Spitalfields rather than those of ever-fashionable Paris; or again,
6
when she prohibited the wearing of ostrich feathers at Court.
The reader will fail to understand the political life of that time and
the difficulties often besetting Pitt until he grasps the fact that George
III not only reigned but governed. His long contest with the Whig
factions left him victor; and it is singular that the shortsightedness of
the elder Pitt signally aided the King in breaking up their power. Both
of them aimed at overthrowing the supremacy of the old Whig
families, but it was George III who profited by the efforts of the Earl of
7
Chatham. The result was seen in the twelve years of almost personal
rule (1770–82), during which Lord North and the well-fed phalanx of
the King’s Friends bade fair to make the House of Commons the mere
instrument of the royal will. The King’s influence, impaired for a time
by the disasters of the American War, asserted itself again at the time
of the Lord George Gordon Riots in June 1780. That outbreak of
bigotry and rascality for a time paralyzed with fear both Ministers and
magistrates; but while all around him faltered, George III held firm
8
and compelled the authorities to act. The riots were quelled, but not
before hundreds of drunken desperadoes had perished in the flames
which they had kindled. Those who saw large parts of London ablaze
long retained a feeling of horror at all popular movements, and looked
upon George III as the saviour of society. This it was, in part, which
enabled him to retain his influence scarcely impaired even by the
disasters of the American War. The monarchy stood more firmly rooted
than at any time since the reign of Queen Anne. Jacobitism survived
among a few antiquated Tories, like Dr. Johnson, as a pious belief or a
fashionable affectation; but even in the year 1763 the lexicographer,
after receiving a pension from George III, avowed to Boswell that the
pleasure of cursing the House of Hanover and of drinking King James’s
health was amply overbalanced by an income of three hundred
pounds.
As a sign of the reality of the royal power, we may note that public
affairs were nearly at a stand-still at the time of the lunacy of George
III (November 1788 to February 1789). The following Foreign Office
despatch, sent to the British Ambassador at Berlin at a critical time in
our diplomatic relations, shows that Pitt and the Foreign Secretary, the
Marquis of Carmarthen, considered themselves the King’s Secretaries
of State, and unable to move until the royal will was known:
* * * * *
Montesquieu praised the English constitution as providing without
undue friction a balance of power between King, Lords, and Commons.
This judgment (penned in 1748) still held good, though the royal
authority had in the meantime certainly increased. But the power of
the nobles was still very great. They largely controlled the House of
Commons. The Lowthers secured the election of 11 Members in the
Lake District; and through the whole country 71 Peers were able
directly to nominate, and secure the election of, 88 commoners, while
they powerfully influenced the return of 72 more. If we include all
landowners, whether titled on untitled, it appears that they had the
power to nominate 487 members out of the 658 who formed the
House of Commons.
In these days, when the thought and activities of the towns
overbear those of the country districts, we cry out against a system
that designedly placed power in the hands of nobles and squires. But
we must remember that the country then far outweighed the towns in
importance; that the produce of the soil was far more valuable than all
the manufactures; and that stability and stolidity are the characteristics
of an ancient society, based on agriculture and reared in Feudalism. If
we except that metropolitan orgy, the Wilkes’ affair, London and
Westminster were nearly as torpid politically as Dorset. Even in the
year 1791 the populace of Manchester and Birmingham blatantly
exulted in a constitution which left them without any direct voice in
Parliament. It was in the nature of things that Grampound, Old Sarum,
Gatton, and Castle Rising should return eight members; the choice of
the Tudor Sovereigns had lit upon those hamlets or villages as test-
places for consulting the will of the nation, and the nation acquiesced,
because, even if Manchester, Birmingham, Leeds, and Sheffield had
enjoyed that privilege, they would probably have sent up country
gentlemen of the same type, and after a far greater output of money
and beer. Where the will of the nation is almost entirely homogeneous
there is no injustice in selecting representatives by the haphazard
methods then in use.
Strong in their control of Parliament, the nobles sought to hem in
the throne by meshes of influence through which even the masterful
and pertinacious George III could with difficulty break. Their circle was
small. True, they had failed in their effort of 1719 to limit the number
of creations at any one time to six; but jealousy had almost the force
of law. Ultimately we find George III declining to confer a dukedom on
any but princes of the blood, and Pitt incurred the displeasure of his
cousin, Earl Temple, because he failed to bend the royal will on that
question. The need of caution in respect to the granting of titles may
be inferred from the Pitt Papers, no small part of which refer to
requests for these honours. Pitt has been reproached with his lavish
use of this governmental device, for he created about 140 peerages in
the years 1783–1801. I have, however, found proofs that he used it
reluctantly. In the Pitt Papers are several letters which the statesman
wrote refusing requests for peerages. On this matter, as also with
regard to places and appointments, he treated any attempt at
bargaining with cold disdain, witness this crushing reply to an Irish
peer who, in September 1799, applied for a British peerage: “... There
is a passage in the conclusion of your Lordship’s letter on which it is
impossible for me not to remark that it appears to convey an
intimation with respect to what may be your political conduct, which
would at all events induce me to decline being the channel of bringing
11
your application before His Majesty.”
But rebukes and refusals seem to have made little impression on
that generation, imbued as it was with a deep-seated belief that the
victors had a right to the spoils and should apportion them among
their followers according to rank and usefulness. The whole matter
was spoken of under the convenient euphemism “influence,” which,
when used in a political sense, denoted the secret means for assuring
the triumph of the Crown and the reward of the faithful. While not
implying actual bribery, it signified persuasion exerted through
peerages, places, and pensions. According to this scheme of things,
strenuous support of “the King’s cause” would earn a title, a bishopric,
a judgeship, or a receivership in the customs or excise. These
allurements offered irresistible attractions in an age which offered far
fewer means of independent advancement than the present. With the
exception of those strange persons who preferred to make their own
way in life, men of all classes had their eyes fixed on some longed-for
perch above them, and divided their attention between the symptoms
of decay in its occupant and the signs of the favour of its patron. The
expectant part of Society resembled a gigantic hen-roost at the
approach of evening, except that the aspirations upward were not
signs of quiescence but of ill-suppressed unrest. Those who delve
among the confidential letters of that time must often picture the
British nation as a mountain-climber. Perhaps one sixth part of Pitt’s
time was taken up in reading and answering requests of bewildering
variety. College friends dunned him with requests for preferment, with
or without cure of souls. Rectors longed to be canons; canons to be
deans; deans to be bishops; and wealthy bishops coveted sinecure
deaneries, among which, curiously enough, that of London was the
greatest prize. The infection spread to all classes. Gaugers of beer
longed to be collectors of His Majesty’s revenue; faithful grooms
confidently expected a gaugership; and elderly fishermen, who in their
day had intercepted smugglers, demanded, as of right, the post of
harbourmaster. A Frenchman once defended the old régime on the
ground that it ranged all classes about the King in due gradations of
privilege. Similarly Britons of their own free will grouped themselves
around the throne on steps of expectancy.
A curious example of the motives which led to influential requests
for preferment in the Church is to be found in the correspondence of
the Marquis of Carmarthen (afterwards Duke of Leeds), who was at
that time Foreign Secretary under Pitt. His letter to his chief may speak
for itself:
Private.
12
Grosvenor Square, Nov. 13 1787.
My dear Sir,
I fear it will not be in my power to return to Hollwood to-
day, by which I shall be prevented from so soon troubling you viva
voce with the only subject I do not like to converse with you upon,
viz., asking for Preferment. But my anxiety for my friend Jackson,
and understanding that the Bishopric of Chester is not yet given
away, will, I hope, plead my excuse to you for asking it for him,
and perhaps you may forgive me adding that from local
circumstances that preferment in his hands would be particularly
agreeable to me, on account of a large part of my northern
property being situated in the Diocese of Chester. I do assure you
that a compliance with this request would make me truly happy.
Believe me, etc.
Carmarthen.
The sketch of West End life given by Moritz, a Prussian pastor who
visited England in 1782, is very similar, but he enters into more detail.
He describes fashionable people as walking about all the morning in a
négligé attire, “your hair not dressed but merely rolled up in rollers,
and in a frock and boots.” The morning lasted till four or five o’clock,
then the fashionable time for dinner. The most usual dress in that
summer was a coat of very dark blue, a short white waistcoat, and
white silk stockings. Black was worn for full dress, and Moritz noticed
that the English seemed to prefer dark colours. Dress seemed to him
to be one of the chief aims and occupations of our people; and he
remarked on the extraordinary vogue which everything French then
enjoyed.
One is tempted to pause here and dwell on the singular fact that,
at the time when England and France were still engaged in deadly
strife, each people should be intent on copying the customs and
fashions of the other. The decade of the “eighties” witnessed the
growth of “Anglomania” to ridiculous proportions in France; while here
the governing class thought it an unfailing proof of good breeding to
trick out every other sentence with a French phrase. Swift alone could
have done justice to the irony of a situation wherein two great nations
wasted their resources in encompassing one another’s ruin, while
every day their words and actions bore striking witness to their
admiration of the hereditary foe. Is it surprising that Pitt should have
used all his efforts in 1786 to bring about an entente cordiale on the
basis of the common interests of the two peoples?
To revert to our theme: the frivolities and absurdities of Mayfair,
which figure so largely in the diaries and letters of the period, probably
filled a smaller space in the life of the nation than we are apt to infer
from those sources. Moritz, who had an eye for the homely as well as
the courtly side of life, noticed the good qualities which kept the
framework of society sound. He remarked that in London, outside the
Court circles, the customs were plain and domestic, the people
19
generally dined about three o’clock, and worked hard. His tour on
foot through the Midlands also gave him the impression that England
enjoyed a well-balanced prosperity. He was everywhere pitied or
despised, it being assumed that a pedestrian must be a tramp. There
can be little doubt that even at the end of that disastrous war, our land
was far more prosperous than any of the States of North Germany.
The wealth of the proud islanders was nowhere more obvious than
at the chief pleasure resorts of Londoners, Vauxhall and Ranelagh.
These gardens and promenades impressed Moritz greatly, and he
pronounced the scene at the rotunda at Ranelagh the most brilliant
which he had ever witnessed: “The incessant change of faces, the far
greater number of which were strikingly beautiful, together with the
illumination, the extent and majestic splendour of the place, with the
continued sound of the music, makes an inconceivably delightful
impression.” Thanks to the curiosity of the Prussian pastor, we can look
down with him on the gay throng, and discern the princes, lords, and
knights, their stars far outshining all the commoners present; we see
also a difference in the styles of wearing the hair, the French queues
and bags contrasting markedly with plain English heads of hair or
professional wigs. Most of the company moved in “an eternal circle, to
see and to be seen”; others stood near to enjoy the music; others
again regaled themselves at the tables with the excellent fare provided
for the inclusive sum of half-a-crown; while a thoughtful minority
gazed from the gallery and moralized on the scene. The display and
extravagance evidently surprised Moritz, as it surprises us when we
remember that it was at the close of a ruinous war. In the third year of
the struggle, the mercurial Horace Walpole deplored the universal
distress, and declared that when he sat in his “blue window,” he
missed nine out of ten of the lordly chariots that used to roll before it.
Yet, in the seventh year, when the half of Europe had entered the lists
against the Island Power, the Prussian pastor saw nothing but
affluence and heard nothing that did not savour of a determined and
sometimes boastful patriotism. At Ranelagh he observed that everyone
wore silk stockings, and he was informed that even poor people when
they visited that abode of splendour, dressed so as to copy the great,
and always hired a coach in order to draw up in state at the
20
entrance.
Ranelagh and Vauxhall, we may note in passing, were beyond the
confines of the London of 1780. The city of Westminster was but
slowly encroaching on Tothill Fields; and the Queen’s House, standing
on the site of the present Buckingham Palace, commanded an
uninterrupted view westwards over the fields and market gardens
spreading out towards the little village of Chelsea. On the south of the
Thames there was a mere fringe of houses from the confines of
Southwark to the Archbishop’s palace at Lambeth; and revellers
returning from Vauxhall, whether by river or road, were not seldom
sobered by visits from footpads, or the even more dreaded Mohawks.
Further afield everything was completely rural. Trotter, Fox’s secretary,
describes the statesman as living amidst bowers vocal with song-birds
at St. Ann’s Hill, Wandsworth; and Pitt, in his visits to Wilberforce or
Dundas at Wimbledon, would probably pass not a score of houses
between Chelsea and the little old wooden bridge at Putney. That
village and Wimbledon stood in the same relation to London as
Oxshott and Byfleet occupy to-day. North of Chelsea there was the
hamlet of Knightsbridge, and beyond it the villages of Paddington and
“Marybone.”
As Hyde Park Corner marked the western limit of London, so
Bedford House and its humbler neighbour, the British Museum,
bounded it on the north. The Foundling Hospital stood in open fields.
St. Pancras, Islington Spa, and Sadler’s Wells were rivals of Epsom and
Tunbridge Wells. Clerkenwell Church was the fashionable place for
weddings for the richer citizens who dwelt in the northern suburbs
opened up by the new City Road completed in 1761. On the east,
London ended at Whitechapel, though houses straggled on down the
Mile End Road. The amount of the road-borne traffic is curiously
illustrated by the fact that the Metropolis possessed only three bridges,
London Bridge, Westminster Bridge, and Blackfriars Bridge; and not till
the year 1763 did the City Fathers demolish the old houses standing
on London Bridge which rendered it impossible for two carts to pass.
Already, however, suburbs were spreading along the chief roads out of
London. In the “Connoisseur” of September 1754 is a pleasingly
ironical account of a week-end visit to the villa of a London tradesman,
situated in the desolate fields near Kennington Common, from the
windows of which one had a view of criminals hanging from gibbets
and St. Paul’s cupola enveloped in smoke.
Nevertheless, the Englishman’s love of the country tended to drive
Londoners out to the dull little suburbs around the Elephant and
Castle, or beyond Tyburn or Clerkenwell; and thus, in the closing years
of the century, there arose that dualism of interests (city versus
suburbs) which weakens the civic and social life of the metropolis. A
further consequence was the waning in popularity of Vauxhall and
Ranelagh, as well as of social clubs in general. These last had
furnished a very desirable relief to the monotony of a stay-at-home
existence. But the club became less necessary when the family lived
beyond the river or at “Marybone,” and when the merchant spent
much time on horseback every day in passing from his office to his
villa. Another cause for the decline of clubs of the old type is doubtless
to be found in the distress caused by the Revolutionary War, and in the
increasing acerbity of political discussions after the year 1790. Hitherto
clubs had been almost entirely devoted to relaxation or conviviality. A
characteristic figure of Clubland up to the year 1784 had been Dr.
Johnson, thundering forth his dicta and enforcing them with thumps
on the table. The next generation cared little for conversation as a fine
art; and men drifted off to clubs where either loyalty or freedom was
the dominant idea. The political arena, which for two generations had
been the scene of confused scrambles between greedy factions, was
soon to be cleared for that deadliest of all struggles, a war of
principles. In that sterner age the butterfly life of Ranelagh became a
meaningless anomaly.
For the present, however, no one in England dreamt of any such
change. The spirit of the nation, far from sinking under the growing
burdens of the American War, seemed buoyant. Sensitive littérateurs
like Horace Walpole might moan over the ruin of the Empire; William
Pitt might declaim against its wickedness with all his father’s
vehemence; but the nation for the most part plodded doggedly on in
the old paths and recked little of reform, except in so far as it
concerned the abolition of sinecures and pensions. In 1779–80 County
Associations were founded in order to press on the cause of
“œconomical reform”; but most of them expired by the year 1784.
Alike in thought and in customs England seemed to be invincibly
Conservative.
The reasons, other than racial and climatic, for the stolidity of
Georgian England would seem to be these. Any approach to
enthusiasm, whether in politics or religion, had been tabooed as
dangerous ever since the vagaries of the High Church party in the
reign of Anne had imperilled the Protestant Succession; and far into
the century, especially after the adventure of “Bonnie Prince Charlie,”
all leanings towards romance were looked on as a reflection on the
safe and solid House of Brunswick. Prudence was the first of political
virtues, and common sense the supreme judge of creeds and conduct.
External events also favoured the triumph of the commonplace,
which is so obvious in the Georgian literature and architecture. The call
of the sea and the influence of the New World were no longer
inspirations to mighty deeds. The age of adventure was past, and the
day of company promoters and slave-raiders had fully dawned.
Commerce of an almost Punic type ruled the world. Whereas the wars
of the sixteenth and seventeenth centuries had turned mainly on
questions of religion, those of the eighteenth centred more and more
on the winning of colonial markets as close preserves for the mother-
country. By the Peace of Utrecht (1713) England gained the first place
in the race for Empire; and a clause of that treaty enabled her to
participate in the most lucrative of trades, the kidnapping of negroes in
Africa for the supply of Spanish-America. Never was there a more
fateful gain. It built up the fortunes of many scores of merchants and
shipowners, but it degraded the British marine and the populace of our
ports, in some of which slaves were openly sold. The canker of its
influence spread far beyond ships and harbours. Its results were seen
in the seared conscience of the nation, and in the lowering of the
sense of the sanctity of human life, which in its turn enabled the blind
champions of law, especially after the scare of 1745, to multiply capital
punishments until more than 160 crimes were punishable by death.
The barbarities of the law and the horrors of the slave-trade finally
led to protests in the name of humanity and religion. These came in
21
the first instance from the Society of Friends. But the philanthropic
movement did not gather volume until it was fed by the evangelical
revival. Clarkson, Zachary Macaulay, Wilberforce (the ablest champion
of the cause), and John Howard, the reformer of prisons, were living
proofs of the connection which exists between spiritual fervour and
love of man. With the foundation, in the year 1787, of the Society for
the Abolition of the Slave Trade, the philanthropic movement began its
career of self-denying effort, which for some five years received
valuable support from Pitt. Other signs of a moral awakening were not
wanting. In 1772 Lord Chief Justice Mansfield declared that all slaves
brought to the United Kingdom became free—a judgement which dealt
the death-blow to slave markets in this country. In 1773 John Howard
began his crusade for the improvement of gaols; and seven years later
Sunday Schools were started by Robert Raikes. The protests of Burke
and Sir Charles Bunbury against the pillory, the efforts of the former in
1784–5 to prevent the disgraceful overcrowding of the prisons, and
the crusade of Romilly against the barbarities of the penal code are
also a tribute to the growth of enlightenment and kindliness.
These ennobling efforts, however, failed to make any impression
on what is termed “Society.” The highest and the lowest strata are, as
a rule, the last to feel the thrill of new movements; for surfeit and
starvation alike stunt the better instincts. Consequently, Georgian
England became strangely differentiated. The new impulses were
quickly permeating the middle classes; but there their influence
ceased. The flinty hardness of the upper crust, and the clayey
sediment at the bottom, defied all efforts of an ordinary kind. The old
order of things was not to be changed save by the explosive forces let
loose in France in 1789. That year forms a dividing line in European
history, as it does in the career of William Pitt.
* * * * *
Though ominous signs of the approaching storm might already be
seen, the noble and wealthy wasted their substance in the usual round
of riotous living. It may be well to glance at two of the typical vices of
the age, drinking and gambling, of course in those circles alone where
they are deemed interesting, for thence only do records reach us.
Drinking did not count as a vice, it was a cherished custom. The
depths of the potations after dinner, and on suitable occasions during
the day, had always been a feature of English life. Shakespeare seems
to aim these well-known lines at the English rather than the Danes:
* * * * *
The mention of Hogarth awakens a train of thought alien to his
self-satisfied age. One begins to inquire what was the manner of life of
those coarse thickset figures who fill the background of his realistic
canvases. Were Englishmen of the lower orders really given over to
Bacchic orgies alternating with long spells of flesh-restoring torpor?
What was their attitude towards public affairs? While Rousseau began
to open out golden vistas of a social millennium, were the toilers really
so indifferent to all save the grossest facts of existence? The question
is difficult to answer. The Wilkes affair seemed for the time to arouse
universal interest, but the low class Londoners who bawled themselves
hoarse for “Wilkes and Liberty” probably cared for that demagogue
mainly because he was a Londoner bent on defying the House of
Commons. Personal feelings rather than political convictions seem to
have determined their conduct; for Wilkes was not reviled a few years
later when he went over to the King’s side. Meanwhile the Gordon
Riots had shown the London populace in another light. As for the
County Reform Associations of the years 1780–4, they had very little
hold upon the large towns, except in Yorkshire; and there the
movement was due to the exceptionally bad representation and to the
support of the great Whig landlords. The experience of those decades
proves that political action which arises out of temporary causes
(especially of a material kind) will lead to little result.
That mercurial and ill-educated populace seems to have shaken off
its political indifference only at the time of a general election. Moritz
describes the tumultuous joy with which Londoners took part in the
election of the year 1782. The sight of carters and draymen eagerly
listening to the candidates at the hustings; their shouts for a speech
from Fox; the close interest which even the poorest seemed to feel in
their country’s welfare, made a deep impression on Moritz, who found
the sight far more exhilarating than that of reviews on the parade
ground at Berlin. His mental comparison of Londoners with the
Romans of the time of Coriolanus was, however, cut short when he
saw “the rampant spirit of liberty and the wild impatience of a genuine
English mob.” At the end of the proceedings the assembly tore down
the hustings, smashed the benches and chairs, and carried the
29
fragments about with them as signs of triumph. Rousseau and
Marat, who saw something of English life during their stay in this
country, declared that Britons were free only during an election; and
the former averred that the use which they made of “the brief
30
moments of freedom renders the loss of liberty well deserved.”
Certainly their elections were times of wild licence; and the authorities
seem to have acquiesced in the carnival as tending to promote a dull,
if not penitential, obedience in the sequel. Not without reason, then,
did Horace Walpole exclaim, at the close of the American War—“War is
a tragedy; other politics but a farce.”
The moralist who cons the stories of the frivolity and vice of that
age is apt to wonder that any progress was made in a society where
war and waste seemed to be the dominant forces. Yet he should
remember that it is the extravagant and exceptional which is
chronicled, while the humdrum activities of life, being taken for
granted, find no place either in newspapers, memoirs, or histories. We
read that in the eight years of the American War the sum of
£115,000,000 was added to the National Debt, the interest on which in
31
the year 1784 amounted to £9,669,435. But do we inquire how a
country, which with great difficulty raised a revenue of £25,000,000 a
year, could bear this load and the far heavier burdens of the
Revolutionary and Napoleonic Wars? The problem seems insoluble
until we remember that British industry was then entering on its most
expansive phase. The condition of our land may be compared with
that of a sturdy oak which has had one of its limbs torn away and its
foliage blighted by a storm. Yet, if the roots grip the soil deep down,
the sap of a single season will restore the verdure, and in a few years
the dome of foliage will rise as shapely and imposing as ever. So was it
to be with England. Her astonishingly quick recovery may be ascribed
partly to the exertions of the great man whose public life will here be
set forth. But one man can do little more than direct the toil of the
many to fruitful issues; and the fruitfulness that marked the first
decade of his supremacy resulted from the contact of the nation’s
roots with a new and fertile layer of soil.
Below the surface of the national life, with its wars and party
intrigues, there lay another world, in which the thoughts of Watt and
Trevithick, of Hargreaves, Arkwright and Cartwright, were slowly taking
shape in actuality. There lay the England of the future. Already its
strength, though but that of an embryo, sufficed to send up enough of
vital sap quickly to repair the losses of war; and the first claim of the
younger Pitt to the title of Statesman lay in his perception of the needs
and claims of this hidden life.
The mechanical inventions which led up to the era of great
production resulted indirectly from the outburst of industrial activity
that followed the victorious issue of the Seven Years’ War. “Necessity is
the mother of Invention”; and the great need after 1763 was to
quicken the spinning of yarn so that the spinsters of a household could
keep the father supplied with enough weft for his loom. This necessity
quickened the wits of a Lancashire weaver, Hargreaves; and in 1764
he constructed his “jenny,” to lighten the toil of his wife. In quick
succession came the inventions of Arkwright and Crompton, as already
noted. The results obtained by the latter were surprising, muslin and
other delicate fabrics being wrought with success in Great Britain. In a
special Report issued by the East India Company in 1793, the
complaint was made that every shop in England offered for sale
“British muslins equal in appearance and of more elegant patterns
than those of India, for one fourth, or perhaps more than one third,
32
less price.” Further improvements increased the efficiency of this
machinery, which soon was used extensively in the north-west of
England, and in Lanarkshire. The populations of Manchester, Leeds,
33
Sheffield, and Birmingham, after 1780, began to increase amazingly.
Hitherto they had numbered between 30,000 and 60,000 souls. Now
they began to outstrip Bristol and Norwich, the second and third of
English cities.
It is noteworthy that the Industrial Revolution in this, its first
phase, brought wealth and contentment to all members of the
community. The quantities of thread, varying in fineness, but severally
invariable in texture and strength, enabled the hand-loom weavers to
push on with their work with none of the interruptions formerly caused
by the inability of hard-pressed spinsters to supply the requisite
amount of yarn. These last, it is true, lost somewhat in economic
independence; for by degrees they sank to the position of wage-
earners in mills, but they were on the whole less hard-worked than
before, water furnishing the power previously applied by the spinster’s
foot; and the family retained its independence because the father and
brothers continued to work up cloth on their own hand-looms and to
sell the produce at the weekly markets of Manchester or Blackburn,
Leeds or Halifax. In the case of the staple industry of Yorkshire, many
men reared the sheep, dressed and dyed the fleeces, worked up the
thread into cloth, and finally, with their sons, took it on a packhorse to
the nearest cloth market. A more complete example of economic
independence it would be difficult to find; and the prosperity of this
class—at once farmers, and dyers, manufacturers, and cloth
merchants—was enhanced by the new spinning machinery which came
rapidly into use after the year 1770.
This fact is emphasized in a vivid sketch of life in a Lancashire
village drawn by one who saw it at the time of these momentous
developments. William Radcliffe describes the prosperity which they
brought to the homes of the farmer-artisans who formed the bulk of
the population of his native village of Mellor, about fourteen miles
north of Manchester. He calls the years 1788 to 1803 the golden age
of the cotton industry. Every out-house in the village was fitted as a
loom-shop; and the earnings of each family averaged from 80 to 100
34
or sometimes even 120 shillings a week. This account, written by a
man who rose to be a large manufacturer at Stockport is probably
overdrawn; but there can be no doubt that the exuberant prosperity of
the North of England provided the new vital force which enabled the
country speedily to rise with strength renewed at the very time when
friends and enemies looked to see her fall for ever. Some idea of the
magnitude of this new source of wealth may be gained from the
official returns of the value of the cotton goods exported from Great
Britain at the following dates:
1710 £5,698
1751 45,986
1764 200,354
1780 355,060
1785 864,710
1790 1,662,369
1795 2,433,331
1800 3,572,217
1806 9,753,824
After 1803 Cartwright’s power-loom came more and more into use,
and that, too, at the time when Watt’s steam-engine became available
for general use. The pace of the Industrial Revolution was thus
accelerated; and in this, its third phase, the far-reaching change
brought distress to the homes of the weavers, as was to be seen in
the Luddite riots of 1810–11. This, however, belongs to a period later
than that dealt with in these pages. Very noteworthy is the fact that in
the years 1785–1806, which nearly cover the official life of Pitt, the
exports of cotton goods increased almost twelvefold in value; and that
the changes in the textile industries enhanced not only the wealth of
the nation but also the prosperity of the working classes in districts
which had been the poorest and most backward.
Limits of space preclude any reference to the revolution wrought in
the iron industry when coal and coke began to take the place of wood
in the smelting of that metal. It must suffice to say that, whereas the
English iron industry had seemed in danger of extinction, it now made
giant strides ahead. In 1777 the first iron bridge was erected at
Coalbrookdale, over the Severn. Six years later Cort of Gosport
obtained a patent for converting pig-iron into malleable-iron by a new
35
and expeditious process; and in 1790 the use of steam-engines at
the blast furnaces trebled their efficiency. This and the former
reference to the steam-engine will suffice to remind the reader of the
enormous developments opened up in all manufactures when the skill
and patience of Watt transformed a scientific toy into the most
important generator of power hitherto used by man.
Thus, in the closing years of the eighteenth century—that much
despised century, which really produced nearly all the great inventions
that the over-praised nineteenth century was merely to develop—the
Industrial Revolution entered on its second phase. The magnets which
thenceforth irresistibly attracted industry, and therefore population,
were coal and iron. Accordingly, as Great Britain had abundance of
these minerals in close proximity, she was able in a very short space of
time to become the workshop of the world. The Eldorado dreamt of by
the followers of Columbus was at last found in the Midlands and
moorlands of the north of England. For the present, the discovery
brought no curse with it. While multiplying man’s powers, it also
stimulated his ingenuity in countless ways. Far from diverting his
energies from work to what is, after all, only the token of work, it
concentrated his thoughts upon productive activity, and thus helped
not only to make work but to make man.
While the moors and vales of the North awakened to new and
strange activities, the agricultural districts of the Midlands and South
also advanced in wealth and population. A scientific rotation of crops,
deep ploughing, and thorough manuring of the soil altered the
conditions of life. Here again England led the way. Arthur Young, in his
“Travels in France” (1787–9) never tires of praising the intelligence and
energy of our great landowners, whereas in France his constant desire
is to make the seigneurs “skip.” In the main, no doubt, the verdict of
Young was just. Landlords in England were the leaders of agricultural
reform. In France they were clogs on progress. Yet, the changes here
were not all for good. That is impossible. The semi-communal and
almost torpid life of the village was unequal to the claims of the new
age; and, amidst much of discomfort and injustice to the poor,
individual tenures, enclosures, and high-farming became the order of
36
the day. New facilities for travel, especially in the form of mail-
coaches, better newspapers (a result of the Wilkes affair)—these and
other developments of the years 1770–84 heralded the dawn of an
age which was to be more earnest, more enlightened, less restful, and
far more complex. The times evidently called for a man who, while
holding to all that was best in the old life, fully recognized the claims
of the coming era. Such a man was William Pitt.
In many respects he summed up in his person the tendencies of
the closing decades of the century, just as the supreme figure of his
father reflected all that was most brilliant and chivalrous in the middle
of the Georgian era. If the elder Pitt raised England to heights of
splendour never reached before, the younger helped to retrieve the
disasters brought on by those who blindly disregarded the warnings of
his father. In the personality both of father and of son there was a
stateliness that overawed ordinary mortals, but the younger man
certainly came more closely into touch with the progressive tendencies
of the age. A student of Adam Smith, he set himself to foster the
industrial energies of the land. In order to further the cause of peace,
he sought the friendship of the French nation, of which Chatham was
the inveterate enemy; and in the brightest years of his career he
seemed about to inaugurate the golden age foretold by the Illuminati.
As by contact with Adam Smith he marched at the head of the new
and peaceful commercialism, so too through his friendship with
Wilberforce he felt the throb of the philanthropic movements of his
times.
For the new stirrings of life in the spheres of religion, art, and
literature, Pitt felt no deep concern. Like his father, and like that great
genius of the South who wrecked his career, he was “a political being.”
In truth, the circumstances of the time compelled him to concentrate
all his energies on public affairs. It was his lot to steer the ship of state
through twenty of the most critical years of its chequered voyage.
Taking the tiller at a time of distress, he guided the bark into calmer
waters; and if he himself did not live on to weather a storm more
prolonged and awful than that from which he at first saved his people,
yet even in the vortex of the Napoleonic cyclone he was to show the
dauntless bearing, the firm faith in the cause of ordered freedom, the
unshaken belief in the destinies of his race, which became the son of
Chatham and the typical Englishman of the age.
CHAPTER I
EARLY YEARS
I am glad that I am not the eldest son, but that I can serve
my country in the House of Commons like papa.—Pitt, May 1766.