Alle Repositories sind wieder da! Falls noch was fehlt: bei Brigitte melden!

Commit 0d1c0393 authored by Christoph Mayr's avatar Christoph Mayr

identifier is now set to id instead of poke_id for solr to recognise it

parent 277fcac0
......@@ -2,7 +2,6 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="03703853-d797-498e-a74c-c726d51baed3" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/index.js" afterPath="$PROJECT_DIR$/index.js" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
......@@ -20,8 +19,8 @@
<file leaf-file-name="index.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-517">
<caret line="22" column="47" lean-forward="false" selection-start-line="22" selection-start-column="47" selection-end-line="22" selection-end-column="47" />
<state relative-caret-position="240">
<caret line="16" column="17" lean-forward="false" selection-start-line="16" selection-start-column="17" selection-end-line="16" selection-end-column="17" />
<folding />
</state>
</provider>
......@@ -182,12 +181,12 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1528804284204</updated>
<workItem from="1528804285428" duration="10549000" />
<workItem from="1528804285428" duration="11961000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="10549000" />
<option name="totallyTimeSpent" value="11961000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="877" extended-state="0" />
......@@ -281,8 +280,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-517">
<caret line="22" column="47" lean-forward="false" selection-start-line="22" selection-start-column="47" selection-end-line="22" selection-end-column="47" />
<state relative-caret-position="240">
<caret line="16" column="17" lean-forward="false" selection-start-line="16" selection-start-column="17" selection-end-line="16" selection-end-column="17" />
<folding />
</state>
</provider>
......
......@@ -14,17 +14,18 @@ pokejson.forEach(function(element){
}
else{
const outJson = {}
outJson["poke_id"] = element.Number
outJson["id"] = element.Number
outJson["poke_txt_en"] = element.Name
outJson["gen_txt_en"] = element.Generation
outJson["about_txt_en"] = element.About
outJson["types_features"] = element.Types
outJson["maxCP_txt_en"] = element.MaxCP
outJson["maxHP_txt_en"] = element.MaxHP
accumData(outJson)
documents.push(outJson)
}
})
sendData(documents)
/*
// read file through fs readstream
......@@ -68,7 +69,7 @@ rl.on('close', function() {
sendData(documents)
documents = []
});
*/
// accumulates JSON objects in array until 10k before they are sent
function accumData(postData) {
......@@ -80,6 +81,8 @@ function accumData(postData) {
documents = []
}
}
*/
// sends data to solr server
function sendData(postData){
......@@ -96,6 +99,7 @@ function sendData(postData){
if (response.statusCode !== 200) {
throw(response.body)
} else {
console.log(response)
console.log('sent')
}
}
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