cancel
Showing results for 
Search instead for 
Did you mean: 

How to create the Lucene Search Query in Webscripts

shanmugaraja
Champ in-the-making
Champ in-the-making
I have the following scenario, i have documents and categories.

D-refers to documents
C-refers to Category.
X - No Reference

The following is the association of documents and category


D1 belongs to  C1   Category
D1 belongs to  C1 and C2  Categories
D3 belongs to  C1, C2 and C3 Categories
D4 belongs to  C2 Category


I want the documents associated to C2 and C3.
Expected result is  D2

How to make the Web scripts for the scenario mentioned above, Any help is highly appreciated. Thanks in advance.
3 REPLIES 3

shanmugaraja
Champ in-the-making
Champ in-the-making
Luis, Thank you for your url links.

I have the following webscript in my alfresco

<webscript>
  <shortname>Categories Search Sample</shortname>
  <description>Sample that finds all entries tagged with specified categories</description>
  <url>/categories?c1={category1?}&xf={xslfile?}</url>
  <url>/categories?c1={category1?}&c2={category2?}&xf={xslfile?}</url>
  <url>/categories?c1={category1?}&c2={category2?}&c3={category3?}&xf={xslfile?}</url>
  <url>/categories?c1={category1?}&c2={category2?}&c3={category3?}&c4={category4?}&xf={xslfile?}</url>
  <url>/categories?c1={category1?}&c2={category2?}&c3={category3?}&c4={category4?}&c5={category4?}&xf={xslfile?}</url>
  <authentication>guest</authentication>
  <transaction>required</transaction>
</webscript>

I have made the url tokens as per the documents specified in the URL.

http://wiki.alfresco.com/wiki/Web_Scripts#URL_Templates


While startup the server i am getting error

14:02:44,985 WARN  [web.scripts.DeclarativeWebScriptRegistry] Unable to register script workspace://SpacesStore/app:company_home/app:dictionary/cm:webscripts/org/alfresco/bgportal/categorysearch.get.desc.xml due to error: Failed to parse web script description document org/alfresco/bgportal/categorysearch.get.desc.xml ; Error on line 4 of document  : The reference to entity "xf" must end with the ';' delimiter. Nested exception: The reference to entity "xf" must end with the ';' delimiter.


is there any thing I am missing in the URL templates.
Any help is appriciated. Thanks in advance

mikeh
Star Contributor
Star Contributor
Hi,

You need to HTML encode those "&" characters to &amp; then try again.

Thanks,
Mike

shanmugaraja
Champ in-the-making
Champ in-the-making
Thanks mike it worked