cancel
Showing results for 
Search instead for 
Did you mean: 

integrate alfresco search in external web application

nancyaggarwal
Champ in-the-making
Champ in-the-making
Hi

I want to add alfresco search in my web application , i do not want to use CMIS query language as it will make performance slow.

how can i directly hit indexes of alfresco repository through my application ??

  










Nancy Aggarwal
7 REPLIES 7

mitpatoliya
Star Collaborator
Star Collaborator
You have to go though the any of the service layers of Alfresco Otherwise I do not think it will be easy job to access those indexes directly.
Other option is to use Alfresco Search Service. For that you can create a webscript which will be deployed on Alfresco side and you will invoke the webscript from your web-application for search in alfresco.
Why do you think CMIS is making your search slower. When you search though OOTB search box or advance search how is the performance?
Also you can optimize your queries which you are passing during search(if there is a scope).

Hi

CMIS will make search slow as bcoz every time user enter any item , every time query will be initiated
it's  like searching whole book to find topic by CMIS query without referring index page.

can you pls tell me which will be optimal option in case of performance CMIS or webscript 

nancyaggarwal
Champ in-the-making
Champ in-the-making
Hi
how can i make search call using web script from web application , can i get any reference , to do same.

mitpatoliya
Star Collaborator
Star Collaborator
OK, here is how you can proceed.

Create webscript which accept various parameter based on which you want to make search.
It will be java based webscript.
Prepare you search query "Lucene" or "XPath" from the parameter passed.
In webscript java controller you can have access to all alfresco core services like "Searchservice",
"NodeService" etc.. with the help of which you can fire query in repo.
It will return you result set which contains list of result nodeRefs.
You can extract required information from that and return as webscript response.

In you webapplication either you can call above webscript either via AJAX or in some back end java class of your application.

Hope things are clear to you.

Hi Mits

Can you tell me one thing when we write  name of the document in the search textbox then where the search hits in the back end to find the document.


Nancy

Hi

how i can extract information from webscript in my application which is using already using CMIS

in case  : if my webscript url is  : /search?docName={arg}

how can i get list of nodeRef's in my application , if my webscript response is in json

mitpatoliya
Star Collaborator
Star Collaborator
You need to first check the response format then you need to parse the response accordingly to get the noderefs from that response object. Logic depends on the language which you are using for calling webscript.