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