Commit f6e02246 authored by Selina Nicole Brunner's avatar Selina Nicole Brunner

update index

parent 368c6c3c
......@@ -6,7 +6,7 @@ const request = require('sync-request')
let documents = []
// read file through fs readstream
const instream = fs.createReadStream('minijson.json') // simplewiki file has to be named 'simplewiki.json'
const instream = fs.createReadStream('pokemon.json', 'utf8') // simplewiki file has to be named 'simplewiki.json'
const outstream = new stream
const rl = readline.createInterface(instream, outstream)
......@@ -26,6 +26,7 @@ rl.on('line', function(line) {
// write relevant properties to output JSON file
outJson["poke_id"] = lineJson.number
outJson["poke_txt_en"] = lineJson.name
outJson["_text_"] = lineJson.name
outJson["gen_txt_en"] = lineJson.generation
outJson["about_txt_en"] = lineJson.about
outJson["types_features"] = lineJson.types
......@@ -75,7 +76,7 @@ function sendData(postData){
}
// on response from server, log response
let response = request('POST', 'http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true&overwrite=true', clientServerOptions);
let response = request('POST', 'http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true&overwrite=true', clientServerOptions)
if (response.statusCode !== 200) {
throw(response.body)
} else {
......
This diff is collapsed.
var solr = require('solr-client')
var util = require('util')
const res = 3
const client= solrClient.createClient('localhost',8983,'gettingstarted','/solr')
<!DOCTYPE html>
<html>
<head>
<title>Pokedex</title>
</head>
<body>
</body>
</html>
<script src="index.js">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment