dp-dd-search-indexer

command module
v0.0.0-...-4eb1c96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2017 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dp-dd-search-indexer

The ONS website is currently using Elastic Search version 2.4. As a result the elastic search client is restricted to version 3: https://github.com/olivere/elastic

Getting started
Elastic search install via brew
  • Install Elastic Search brew install elasticsearch@2.4
  • Ensure the cluster.name property is set to cluster.name: elasticsearch. The configuration file can be found at /usr/local/etc/elasticsearch/elasticsearch.yml. For some reason it appended my username onto the end of the default clustername.
  • Start Elastic Search service brew services start elasticsearch@2.4
  • Run it elasticsearch
Elastic search via dp-compose

The dp-compose project requires the native docker for mac (not docker toolbox)

git clone git@github.com:ONSdigital/dp-compose.git
cd dp-compose
./run.sh
Load the template into ElasticSearch
curl -XPUT localhost:9200/_template/base -d @template.json
Run the search indexer
make debug
Send a search index via HTTP
curl -X POST -d '{"type":"dataset","id":"666"}' localhost:20050/index
Send an area search index via HTTP
curl -X POST -d '{"id":"JdqPL8h0w8QqciugIvCTomSUpNE=","type":"area","body":{"title":"Cardiff","type":"Unitary Authority"}}' localhost:20050/index-area
Send a search index request via Kafka (assumes Kafka is installed and the KAFKA_ADDR environment variable has been set.)
kafka-console-producer --broker-list localhost:9092 --topic search-index-request
{"type":"testtype","id":"234"}
Configuration
Environment variable Default Description
BIND_ADDR :20050 The port to serve HTTP requests on
ELASTIC_SEARCH_NODES http://127.0.0.1:9200 The Elastic Search node addresses comma separated
ELASTIC_SEARCH_INDEX ons The Elastic Search index to update
Contributing

See CONTRIBUTING for details.

License

Copyright©‎ 2016-2017, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址