Hi Lalaji,

On Fri, Apr 25, 2014 at 11:07 AM, Lalaji Sureshika <[email protected]> wrote:

> Hi Ajith,
>
> Appreciate your feedback on below queries.
>
> 1. Can we add a custom indexer to trigger indexing only in a particular
> registry path based on particular media types.
> [For eg: we only need to index registry resources in
> _system/governance/apimgt/applicationdata/api-docs with media types
> application/json, application/pdf,application/msword and application/text]
>

Please find the set of indexers as references[1]. You can register new
indexer in the registry.xml filtering by media type[2].

Eg:
<indexer class="org.wso2.carbon.registry.indexing.indexer.PDFIndexer"
mediaTypeRegEx="application/pdf"/>

Yes. You can filer by path before creating "IndexDocument" instance.

[1]
https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/registry/org.wso2.carbon.registry.indexing/4.2.1/src/main/java/org/wso2/carbon/registry/indexing/indexer/
[2]
https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/greg/4.6.0/modules/distribution/src/main/resources/carbon-home/conf/registry.xml


>
> 2.  We want to do search based on above indexed registry resources,if so
> how we can write a custom search client to achieve this only to filter the
> above indexed type resources.Appreciate any code reference on how to do
> this..
>

You can use the SolrClient to get an instance and query[3].

[3]
https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/registry/org.wso2.carbon.registry.indexing/4.2.1/src/main/java/org/wso2/carbon/registry/indexing/service/ContentBasedSearchService.java

Thanks.
Ajith.


>
> Thanks;
>
> --
> Lalaji Sureshika
>  WSO2, Inc.;  http://wso2.com/
> email: [email protected]
> blog: http://lalajisureshika.blogspot.com
>
>


-- 
Ajith Vitharana.
WSO2 Inc. - http://wso2.org
Email  :  [email protected]
Mobile : +94772217350
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to