27
Made in Norway

Enonic Content Repository built on elasticsearch

  • Upload
    enonic

  • View
    377

  • Download
    1

Embed Size (px)

Citation preview

Made in N

orway

Web CMS

Nashorn / "NodeJS"

Security Framework

Module System (OSGi)

HTML5 Framework (Typescript)

Storage (Elasticsearch)

Storing data

• Git

• Java Content Repository

• Elasticsearch

content repository

_id = 1001 _name = ‘OSLO’ _parent = ROOT

displayName = ‘Oslo’ data.population = 647676 data.area = 454.03

_id = 1001 _name = ‘oslo’ _parent = ROOT

displayName = ‘Oslo’ data.population = 647676 data.area = 454.03 location = geoPoint(’59.9127300,10.7460900’)

_ID = 1041 _name = ‘elasticon’ _parent = ‘4021’ category = 'conference' displayName = ‘elasticon' keywords = ['ELK', elasticsearch’] location = ref(2) description = ‘largest gathering of

ELK expertise in the world’

content repository

_id = 13 _name = ‘opera.png’ _parent = ‘1001

size = 70056 height = 360

_id = 4021 _name = ‘sf’ _parent = ROOT

displayName = ‘San Francisco’ data.population = 837442 data.area = 600.6

repositories

AccessControl AccessControl AccessControl

Staging support Staging support Staging support

Versioning Versioning Versioning

Search Search Search

myDataRepo myUserRepo myStuffRepo

node versions

BlobStore

_id = 1001

displayName = ‘Oslo’ data.population = 647676 data.area = 454.03 location = geoPoint(’59.9127300,10.7460900’)

_id = 13

size = 70056 height = 360 width = 1024

_id = 1001

displayName = ‘Oslo’ data.population = 647676 data.area = 454.03

_id = 1041

category = 'conference' displayName = ‘elasticon' keywords = ['ELK', elasticsearch’] location = ref(2) description = ‘largest gathering of ELK expertise in the world’

_id = 4021

displayName = ‘San Francisco’ data.population = 837442 data.area = 600.6

branch

_id = 2 _version = 1

type = ‘city’ displayName = ‘San Francisco’ data.population = 837442 …

_id = 1431-1240-1231-1234 _version = 1

category = 'conference' name = 'Elasticon' keywords = ['ELK', elasticsearch’] …

_id = 1234-1234-1234-1234 _version = 1

displayName = ‘Oslo’ data.population = 647676 …

_id = 1234-1234-1234-1234 _version = 2

displayName = ‘Oslo’ data.population = 647676 location = geoPoint(’59.9127300,10.7460900’) /

_id = 1010 _version = 1

size = 70056 height = 360 …

/oslo

/oslo/opera.png

/sf

/sf/elasticon

branch: master

branch

_id = 2 _version = 1

type = ‘city’ displayName = ‘San Francisco’ data.population = 837442 …

_id = 1431-1240-1231-1234 _version = 1

category = 'conference' name = 'Elasticon' keywords = ['ELK', elasticsearch’] …

_id = 1234-1234-1234-1234 _version = 1

displayName = ‘Oslo’ data.population = 647676 …

branch: master

/

/oslo

branch: myDrafts

_id = 1234-1234-1234-1234 _version = 2

displayName = ‘Oslo’ data.population = 647676 location = geoPoint(’59.9127300,10.7460900’) /

_id = 1010 _version = 1

size = 70056 height = 360 …

/oslo

/oslo/opera.png

/sf

/sf/elasticon

/sf

/elasticon

branch: push

_id = 2 _version = 1

type = ‘city’ displayName = ‘San Francisco’ data.population = 837442 …

_id = 1431-1240-1231-1234 _version = 1

category = 'conference' name = 'Elasticon' keywords = ['ELK', elasticsearch’] …

_id = 1234-1234-1234-1234 _version = 1

displayName = ‘Oslo’ data.population = 647676 …

branch: masterbranch: myDrafts

_id = 1234-1234-1234-1234 _version = 2

displayName = ‘Oslo’ data.population = 647676 location = geoPoint(’59.9127300,10.7460900’) /

_id = 1010 _version = 1

size = 70056 height = 360 …

/oslo

/oslo/opera.png

/sf

/sf/elasticon

/

/oslo

/oslo/opera.png

/sf

/sf/elasticon

indices

store-indices search-indices

store

search-index

type : version

type : branch

search

store-index search-index

type: branch-1

type : branch-2

type : branch-n

mapping

Nodes are schema-less

indexField = property-path + value type

mapping cont.

• myProperty (String)

• myProperty._analyzed

• myProperty._ngram

• myProperty._number

• myProperty._geoPoint

• myProperty._orderBy

string mapping

“name": “san-fancisco” “name._orderby": “san-fancisco"

name = ‘san-fancisco’

text mapping

“description": “this is…” “description._fulltext": “this is…” “description._ngram": “this is…" “description._orderby": “this is…"

description = ‘this is the description’

Numeric mapping

“data.area": “600.6” “data.area._number”: 600.6 “data.area._orderby": “dc082c4cccccccccd"

data.area = 600.6

ES Aggregations ES Queries

search

ES Filters

Enonic XP Query-language

Enonic XP Search API

javascript API

execute('content.query', { "count": 100, "start": 0, "query": "fulltext('myField', 'searching for cheese', 'AND')", "filter": “type=‘article’", "aggregations": { "genders": { "terms": { "field": "gender", "order": "_count asc", "size": 2 } } } });

query-language

title LIKE ‘elast*’ OR

category IN (‘conference’, ‘event’)

ORDER BY title ASC

query-language

{ "from" : 0, "size" : 10, "query" : { "filtered" : { "query" : { "bool" : { "should" : [ { "wildcard" : { "title" : { "wildcard" : “elast*” } } }, { "bool" : { "should" : [ { "term" : { "category" : "conference" } }, { "term" : { “category" : “event" } } ] } } ] } }, "filter" : { "terms" : { "_permissions.read" : [ "role:system.authenticated", "user:system:test-user" ] } } } },

"sort" : [ { "title._orderby" : { "order" : "asc", "ignore_unmapped" : true } } ] }

query-language

category = ‘conference’

AND ngram(‘description’, ‘elast elk’, ‘OR’)

query-language

{ "from" : 0, "size" : 10, "query" : { "filtered" : { "query" : { "bool" : { "must" : [ { "term" : { "category" : "conference" }

}, { "simple_query_string" : { "query" : "elast elk", "fields" : [ "description._ngram" ], "default_operator" : "or" } } ] } }, "filter" : { "terms" : { "_permissions.read" : [ "role:system.authenticated", "user:system:test-user" ] } } } } }

security

• _permissions.create

• _permissions.delete

• _permissions.modify

• _permissions.publish

• _permissions.read

• _permissions.readpermissions

• _permissions.writepermissions

security filter

"filter" : { "terms" : { "_permissions.read" : [

"role:system.authenticated", "user:system:test-user" "group:system:my-group" ]

} }

questions?

github.com/enonic/xp