Alfresco in few points - Search Tutorial

29,563 views

Published on

Published in: Technology
6 Comments
24 Likes
Statistics
Notes
No Downloads
Views
Total views
29,563
On SlideShare
0
From Embeds
0
Number of Embeds
4,709
Actions
Shares
0
Downloads
1,329
Comments
6
Likes
24
Embeds 0
No embeds

No notes for slide

Alfresco in few points - Search Tutorial

  1. 1. What is this flower ? Search Tutorial
  2. 2. This represents Alfresco !
  3. 3. An ECM Open Source Solution
  4. 4. Where is the Problem ?
  5. 5. Curious people who want to understand Alfresco…
  6. 6. With lots of questions… (To express…)
  7. 7. A possible solution…
  8. 8. Simply a presenter with presentations about Alfresco
  9. 9. with a few answers… (To verify)
  10. 10. Let’s do it !
  11. 11. But before starting, here is a reminder !
  12. 12. The principle is… Everything is a NODE! I am a beautiful node!
  13. 13. The rule is… Alfresco provides services to manage Nodes Even I have a manager…
  14. 14. Now let’s go!
  15. 15. As far as I understand, different language can be possibly used to do searches…
  16. 16. Indeed! Let’s have a look…
  17. 17. Lucene XPath
  18. 18. Lucene first!
  19. 19. 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
  20. 20. And with Alfresco… How does it work?
  21. 21. Put in a nutshell…
  22. 22. 1. Collect Type Aspect Properties Key words ID
  23. 23. 2. Preserve ID As pec Type t Proper ties Key w ords
  24. 24. 3. Use es P roperti Key words Aspect
  25. 25. To push further…
  26. 26. 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
  27. 27. 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
  28. 28. To check it…
  29. 29. Have a look into the data model! File : contentModel.xml
  30. 30. What does the « tokenize » principle mean? File : contentModel.xml
  31. 31. Tokenising is to split (or not) a word into one or many key words.
  32. 32. Example Here is a PowerPoint presentation regarding Alfresco and its search feature.
  33. 33. Without « Tokenisation »… t t en C onHere is a PowerPoint presentation regarding Alfresco and its search feature.
  34. 34. 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.
  35. 35. 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.
  36. 36. 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.
  37. 37. 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
  38. 38. So don’t forget to check your data model !
  39. 39. OK… Demo time!
  40. 40. A bi t of theory
  41. 41. 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)
  42. 42. The Querie s
  43. 43. 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???
  44. 44. To query on the Type TYPE:quot; <TypeQName> quot; Hopefully you remember what’s the QName… Otherwise click here
  45. 45. To query on a property @<QNamePropriété>:quot; Value quot; Why is it different than the other queries?? Why is it not upper case ?
  46. 46. To query on an Aspect ASPECT:quot; <AspectQName> quot; AAhh! That’s better!
  47. 47. To query on a key word included in the content of the node TEXT:<value> Okey… Understood! I am getting bored…
  48. 48. Contex t
  49. 49. Here is our battle field
  50. 50. Practic e
  51. 51. 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!
  52. 52. How to make a simple query with Lucene Connect as « admin » to Alfresco Click on Choose the node browser
  53. 53. How to make a simple query with Lucene Choose the store : workspace://SpacesStore In the drop down list, choose Lucene
  54. 54. Ready ?
  55. 55. I want the « Folder Test »
  56. 56. I want the « Folder Test »!!!!! @cm:name:’’Folder Test’’
  57. 57. Result
  58. 58. Reminder !
  59. 59. To identify and make a node unique in a store, we use… A UUID
  60. 60. The concatenation of the protocole, the name of the store and the UUID of a node is A NodeRef
  61. 61. In our case NodeRef UUID
  62. 62. I want the « Foder Test » with the UUID ID:quot;workspace://SpacesStore/ b7ecc8b1-5edb-11dd- afdd-79a008cbb404quot;
  63. 63. What about a search with several criterias ?
  64. 64. You can add Operators !
  65. 65. 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
  66. 66. 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;
  67. 67. Result
  68. 68. Let’s add a category to a space Contex t
  69. 69. 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;
  70. 70. 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;
  71. 71. Result
  72. 72. Let’s have a look into the property types
  73. 73. Note Work Zone! This section is experimental and results vary a lot according to the tests!
  74. 74. To search for text properties, you can use specific operators
  75. 75. Special Operators ? Can replace one character * Can replace one or many characters
  76. 76. 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;
  77. 77. 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;
  78. 78. Note End of work zone! This section was experimental!
  79. 79. 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
  80. 80. Now XPath!
  81. 81. XPath ? • XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. • Source w3c.org
  82. 82. But we are dealing with nodes… Not with xml…
  83. 83. Yes indeed but…
  84. 84. A Principle… A Node can be identified as an xml What a face I have Mirror now… XML
  85. 85. The proof in Alfresco…
  86. 86. ACP WebApp
  87. 87. ACP Explorer
  88. 88. So XPath enables us to browse the nodes…
  89. 89. Indeed ! Demo...
  90. 90. A bit of theo ry
  91. 91. XPath in Alfresco enables to query on… • The Type • The Properties Of a Node! • The Aspects • The Associations Why me…
  92. 92. Axis
  93. 93. In the Node family, I want to find myself ! self
  94. 94. Then my Father! parent
  95. 95. Then my children! Child
  96. 96. Then my older brothers preceding-sibling
  97. 97. Then my younger sisters following-sibling
  98. 98. Now let’s explore my family further
  99. 99. I want to know my entire lineage! descendant
  100. 100. I want to know my ancestors ancestor
  101. 101. I want to know all the oldest nodes in my family preceding
  102. 102. I want all the youngest nodes following
  103. 103. Isn’t my family beautiful?
  104. 104. Unfortunately, all my family are not visible in Alfresco… following following-sibling preceding-sibling preceding
  105. 105. The qu e ries
  106. 106. To query on an axis Axe::* I want to know all the nodes on this axis!
  107. 107. To query on a property Axe::*[@<QName>:’<Value>’] It remind me of Lucene…
  108. 108. To query on an aspect Axe::*[hasAspect(’<QNameAspect>’)] The aspect doesn’t make the node!
  109. 109. To query on a type Axe::*[subtypeOf(’<QNameType>’)] Beware! This means the current and child types!!!
  110. 110. To query on the entire set of properties and content… Axe::*[contains(’<Value>’)] Beware! This means the current and child types!!!
  111. 111. Contex t
  112. 112. Here is our battle field
  113. 113. Practic e
  114. 114. How to make a simple query with Lucene Connect as « admin » to Alfresco Click on Choose the node browser
  115. 115. How to make a simple query with Lucene Choose the store : workspace://SpacesStore In the drop down list, choose Lucene
  116. 116. Why don’t we use XPath ??
  117. 117. It’s exactly the same! Except that…
  118. 118. XPath : From the root of the store SelectNodes : Related to the current node
  119. 119. We want to start from a specific folder!
  120. 120. Ready ?
  121. 121. I want the current node self::*
  122. 122. Result
  123. 123. I want the children of the current node descendant::*
  124. 124. I want the parent of the current node parent::*
  125. 125. I want the child which has a description « Space 1.1 Description » descendant::*[@cm:description ='Space 1.1 Description']
  126. 126. Also note that operators are also available in XPath…
  127. 127. 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')]
  128. 128. 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')]
  129. 129. 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!)
  130. 130. I now have many nodes! But where is Wally/Waldo…? Well actually… where is the good node?
  131. 131. If you are looking for a node, use the services…
  132. 132. First, Think about Alfreso Service Registry !
  133. 133. 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
  134. 134. 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
  135. 135. 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
  136. 136. Voilà! Enough for today!
  137. 137. Now your turn!
  138. 138. Questions ???
  139. 139. Another time…
  140. 140. Next…
  141. 141. What if I want to share my nodes ?
  142. 142. You would have to use the protocoles…
  143. 143. To discover…
  144. 144. To go further on…
  145. 145. And to reach our goals…
  146. 146. Choose ECM Open Source
  147. 147. Alfresco in few points… By JM.PASCAL www.opensourceecm.fr & www.open-source-ecm.com

×