Alfresco in few points - Search Tutorial

60 %
40 %
Information about Alfresco in few points - Search Tutorial
Technology

Published on November 3, 2008

Author: JM.Pascal

Source: slideshare.net

What is this flower ? Search Tutorial

This represents Alfresco !

An ECM Open Source Solution

Where is the Problem ?

Curious people who want to understand Alfresco…

With lots of questions… (To express…)

A possible solution…

Simply a presenter with presentations about Alfresco

with a few answers… (To verify)

Let’s do it !

But before starting, here is a reminder !

The principle is… Everything is a NODE! I am a beautiful node!

The rule is… Alfresco provides services to manage Nodes Even I have a manager…

Now let’s go!

As far as I understand, different language can be possibly used to do searches…

Indeed! Let’s have a look…

Lucene XPath

Lucene first!

Lucene ? • Apache Lucene is a high- performance, full-featured text search engine library written entirely in Java. • Although Lucene provides the ability to create your own queries through its API, it also provides a rich query language through the Query Parser, a lexer which interprets a string into a Lucene Query using JavaCC. • Source: Lucene.org

And with Alfresco… How does it work?

Put in a nutshell…

1. Collect Type Aspect Properties Key words ID

2. Preserve ID As pec Type t Proper ties Key w ords

3. Use es P roperti Key words Aspect

To push further…

When a node is created, the following actions take place • Indexing of the whole set of the items properties • Plain text Indexing of the related content

When a node is created: • The plain text indexing takes place if the content format is: – Office (Open ou Microsoft) – XML/HTML – PDF – Emails – Texte

To check it…

Have a look into the data model! File : contentModel.xml

What does the « tokenize » principle mean? File : contentModel.xml

Tokenising is to split (or not) a word into one or many key words.

Example Here is a PowerPoint presentation regarding Alfresco and its search feature.

Without « Tokenisation »… t t en C onHere is a PowerPoint presentation regarding Alfresco and its search feature.

A copy of the whole sentence is made in the index t t en C onHereis a PowerPoint presentation regarding Alfresco and its search feature. D EX IN Here is a PowerPoint presentation regarding Alfresco and its search feature.

The search would then be done on the whole sentence! u t en C onHere is a PowerPoint presentation regarding Alfresco and its search feature. D EX IN Hereis a PowerPoint presentation regarding Alfresco and its search feature.

However if the sentence is split into key words… u t en C on Here is a PowerPoint presentation regarding Alfresco and its search feature.

The serach can be done on those key words only! u t en C on Here is a PowerPoint presentation regarding Alfresco and its search feature. D EX IN Presentation,PowerPoint, Alfresco, search

So don’t forget to check your data model !

OK… Demo time!

A bi t of theory

Lucene in Alfresco enables you to query on • The NodeRef (ID) • The Type Of a NODE! • The Properties • The Aspects Do you work for the secret services ? • The key Words (Content)

The Querie s

To query on the Noderef ID:quot; <Mon NodeRef> quot; What is the interest of searching for a node we already know the name of???

To query on the Type TYPE:quot; <TypeQName> quot; Hopefully you remember what’s the QName… Otherwise click here

To query on a property @<QNamePropriété>:quot; Value quot; Why is it different than the other queries?? Why is it not upper case ?

To query on an Aspect ASPECT:quot; <AspectQName> quot; AAhh! That’s better!

To query on a key word included in the content of the node TEXT:<value> Okey… Understood! I am getting bored…

Contex t

Here is our battle field

Practic e

Note Lucene and Alfresco! According to the Alfresco version you are working with, you can get completely different results than those presented in here. This is the magic of the search feature!

How to make a simple query with Lucene Connect as « admin » to Alfresco Click on Choose the node browser

How to make a simple query with Lucene Choose the store : workspace://SpacesStore In the drop down list, choose Lucene

Ready ?

I want the « Folder Test »

I want the « Folder Test »!!!!! @cm:name:’’Folder Test’’

Result

Reminder !

To identify and make a node unique in a store, we use… A UUID

The concatenation of the protocole, the name of the store and the UUID of a node is A NodeRef

In our case NodeRef UUID

I want the « Foder Test » with the UUID ID:quot;workspace://SpacesStore/ b7ecc8b1-5edb-11dd- afdd-79a008cbb404quot;

What about a search with several criterias ?

You can add Operators !

Operators + To add a validated criteria - To add a non validated criteria AND To add a criteria OR To add a choice between several criterias NOT To exclude a criteria

I want all the spaces with the name « space » TYPE:quot;cm:folderquot; AND @cm:name:quot;Spacequot; TYPE:quot;cm:folderquot; +@cm:name:quot;Spacequot; +TYPE:quot;cm:folderquot; AND @cm:name:quot;Spacequot;

Result

Let’s add a category to a space Contex t

I want all folders with the name « space » which has a category TYPE:quot;cm:folderquot; AND @cm:name:quot;Spacequot; AND ASPECT:quot;cm:generalclassifiablequot;

I want all spaces with the name « space » which DOES NOT have a category TYPE:quot;cm:folderquot; AND @cm:name:quot;Spacequot; AND NOT ASPECT:quot;cm:generalclassifiablequot; TYPE:quot;cm:folderquot; +@cm:name:quot;Spacequot; -ASPECT:quot;cm:generalclassifiablequot;

Result

Let’s have a look into the property types

Note Work Zone! This section is experimental and results vary a lot according to the tests!

To search for text properties, you can use specific operators

Special Operators ? Can replace one character * Can replace one or many characters

I want all spaces with the name starting with « spa » TYPE:quot;cm:folderquot; AND @cm:name:quot;Spa*quot; TYPE:quot;cm:folderquot; +@cm:name:quot;Spa*quot;

I want all spaces with the name ending with « spa » TYPE:quot;cm:folderquot; AND @cm:name:quot;*acequot; TYPE:quot;cm:folderquot; +@cm:name:quot;*acequot;

Note End of work zone! This section was experimental!

For more details… Lucene WebSite • http://lucene.apache.org/ • http://lucene.apache.org/java/docs/queryparsersyntax.html Alfresco Wiki • http://wiki.alfresco.com/wiki/Search#Lucene • http://wiki.alfresco.com/wiki/Lucene • http://wiki.alfresco.com/wiki/Lucene_Extensions_and_Issues

Now XPath!

XPath ? • XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. • Source w3c.org

But we are dealing with nodes… Not with xml…

Yes indeed but…

A Principle… A Node can be identified as an xml What a face I have Mirror now… XML

The proof in Alfresco…

ACP WebApp

ACP Explorer

So XPath enables us to browse the nodes…

Indeed ! Demo...

A bit of theo ry

XPath in Alfresco enables to query on… • The Type • The Properties Of a Node! • The Aspects • The Associations Why me…

Axis

In the Node family, I want to find myself ! self

Then my Father! parent

Then my children! Child

Then my older brothers preceding-sibling

Then my younger sisters following-sibling

Now let’s explore my family further

I want to know my entire lineage! descendant

I want to know my ancestors ancestor

I want to know all the oldest nodes in my family preceding

I want all the youngest nodes following

Isn’t my family beautiful?

Unfortunately, all my family are not visible in Alfresco… following following-sibling preceding-sibling preceding

The qu e ries

To query on an axis Axe::* I want to know all the nodes on this axis!

To query on a property Axe::*[@<QName>:’<Value>’] It remind me of Lucene…

To query on an aspect Axe::*[hasAspect(’<QNameAspect>’)] The aspect doesn’t make the node!

To query on a type Axe::*[subtypeOf(’<QNameType>’)] Beware! This means the current and child types!!!

To query on the entire set of properties and content… Axe::*[contains(’<Value>’)] Beware! This means the current and child types!!!

Contex t

Here is our battle field

Practic e

How to make a simple query with Lucene Connect as « admin » to Alfresco Click on Choose the node browser

How to make a simple query with Lucene Choose the store : workspace://SpacesStore In the drop down list, choose Lucene

Why don’t we use XPath ??

It’s exactly the same! Except that…

XPath : From the root of the store SelectNodes : Related to the current node

We want to start from a specific folder!

Ready ?

I want the current node self::*

Result

I want the children of the current node descendant::*

I want the parent of the current node parent::*

I want the child which has a description « Space 1.1 Description » descendant::*[@cm:description ='Space 1.1 Description']

Also note that operators are also available in XPath…

I want the child which has a description « Space 1.1 Description » and that is of type folder descendant::*[@cm:description ='Space 1.1 Description' and subtypeOf('cm:folder')]

I want the child which has its aspect related to categories and is of type folder descendant::*[hasAspect('cm:genera lclassifiable') and subtypeOf('cm:folder')]

To go further… • Wikipedia [FR] • W3Schools[ENG] • Spécifications W3C : Xpath 1.0[ENG] • Spécifications W3C : XPath 2.0[ENG] • Developpez.com (A voir!)

I now have many nodes! But where is Wally/Waldo…? Well actually… where is the good node?

If you are looking for a node, use the services…

First, Think about Alfreso Service Registry !

And then call … AttributeService MultilangualContentService AuditService ScriptService ActionService AuthorityService AuthenticationService SearchService RuleService NodeService TemplateService AVMService CopyService LockService CategoryService CheckOutCheckInService FileFolderService ContentService MimeTypeService EditionService DictionnaryService WorkflowService ImporterService ExporterService VersionService TransactionService

And then call … AttributeService MultilangualContentService AuditService ScriptService ActionService AuthorityService AuthenticationService SearchService RuleService NodeService TemplateService AVMService CopyService LockService CategoryService CheckOutCheckInService FileFolderService ContentService MimeTypeService EditionService DictionnaryService WorkflowService ImporterService ExporterService VersionService TransactionService

Or… AttributeService MultilangualContentService AuditService ScriptService ActionService AuthorityService AuthenticationService SearchService RuleService NodeService TemplateService AVMService CopyService LockService CategoryService CheckOutCheckInService FileFolderService ContentService MimeTypeService EditionService DictionnaryService WorkflowService ImporterService ExporterService VersionService TransactionService

Voilà! Enough for today!

Now your turn!

Questions ???

Another time…

Next…

What if I want to share my nodes ?

You would have to use the protocoles…

To discover…

To go further on…

And to reach our goals…

Choose ECM Open Source

Alfresco in few points… By JM.PASCAL www.opensourceecm.fr & www.open-source-ecm.com

Add a comment

Related presentations

Related pages

Alfresco in few points - Search Tutorial - Technology

1. What is thisflower ? Search Tutorial 2. This representsAlfresco ! 3. An ECM Open Source Solution 4. Where is the Problem ? 5. Curious people who want to ...
Read more

Alfresco | LinkedIn

Alfresco in few points - Search Tutorial Views 28,709 views. Alfresco In An Hour ... Alfresco in few points - Node Tutorial Views 23,143 views. Alfresco in ...
Read more

Alfresco in few points - Search Tutorial - PdfSR.com

What is this flower ? Search Tutorial This represents Alfresco ! An ECM Open Source Solution Where is the Problem ? Curious people who want to ...
Read more

Tutorial and Presentation | Alfresco Forums

Tutorial and Presentation ... net/JM.Pascal/alfresco-in-few-points-node-tutorial ... source-ecm.com/2008/11/tutorial-alfresco-search-with ...
Read more

Alfresco-Tutorial.pdf | Alfresco Forums

... encountered a few ... you are still able to search the ... One of the first things that appear after logging in is an "Alfresco Tutorial", ...
Read more

Alfresco in few points - Node Tutorial - Technology

Home; Technology; Alfresco in few points - Node Tutorial; Alfresco in few points - Node Tutorial Oct 18, 2014 Technology
Read more

Alfresco in few points Search Tutorial Poster - wallpart.com

Alfresco in few points Search Tutorial or alfresco-in-few-points-search-tutorial-44-728 Poster - Find more Prints in the Wallpart shop.
Read more

About the Alfresco Developer Tutorial Series | ECM Architect

The "Alfresco Developer" series of tutorials ... Tutorial Series . The “Alfresco Developer” series of ... advance search in Alfresco, ...
Read more