Skip to content

arboliveira/liferay-geolocation-bulk-import

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GEOLOCATION DEMO DATASET BULK LOAD


How to install

Download the latest release and drop into deploy under your Liferay server dir.

How to use

Add > Widgets > Search Development > Geolocation Bulk Load

You can create up to 1,000 documents.

Is this thing on?

Control Panel > Configuration > Gogo Shell

(or alternatively, Gogo Shell from the command line)

Confirm this module has been loaded:

lb "Liferay Geolocation Bulk Load"

Confirm the command is available:

help | grep geolocation

Execute the command:

geolocation:load

You can pass a number as a parameter to determine how many documents will be inserted. If you choose to not pass any number, the default value will be 10.

Building from source

Clone this repository.

Create a Liferay Workspace with the Blade CLI if you don't have one.

Note: the Liferay Workspace should be configured in an empty directory - not under portal-master.

Move this project under modules in your Liferay Workspace (the one you configured above).

Run deploy.sh (requires env vars) to build and deploy the bundle into Liferay.

Start Liferay.

Troubleshooting

If the project doesn't build correctly, or the bundle doesn't start immediately after deployment, double check module versions in bnd.bnd, dependencies versions in build.gradle, and versions of same packages deployed in Liferay.

Database x Elasticsearch check

After running the load command, you can check if everything was indexed correctly. Just count the number of rows in the JournalArticle table in the DB and then count the number of documents indexed in the Elasticsearch to see if they match.

Run the following query to count the number of Journal Articles inserted in the database of your choice (syntax may differ depending on the database):

SELECT companyId, count(*) FROM JournalArticle group by companyId;

Run the following query to count the number of Journal Articles indexed in the Elasticsearch server:

curl -XPOST 'http://localhost:9200/_search?pretty' --data \
\
'{
  "size": 0,
  "aggregations": {
    "JournalArticle per companyId": {
      "terms": {
        "field": "companyId"
      }
    }
  },
  "query": {
    "term": {
      "entryClassName": "com.liferay.journal.model.JournalArticle"
    }
  }
}'

If you're using elasticsearch-head to run this query, make sure you're using the POST method instead of GET.

Source data

https://data.boston.gov/dataset/311-service-requests/resource/2968e2c0-d479-49ba-a884-4ef523ada3c0

https://www.boston.gov/departments/innovation-and-technology/apps#bos-311

https://www.cityofboston.gov/311/

https://data.boston.gov/dataset/311-service-requests

https://data.boston.gov/group

APIS

https://github.com/socrata/datasync

https://github.com/socrata/soda-java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.7%
  • Shell 0.3%