Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

(AEM 6.1 + SOLR) OOTB search api usage

Avatar

Level 5

https://docs.adobe.com/docs/en/aem/6-0/deploy/upgrade/queries-and-indexing.html

Based on the above link - The purpose of the Solr index is mainly full-text search but it can also be used to index search by path, property restrictions and primary type restrictions. This means the Solr index in Oak can be used for any type of JCR query. 

1) How the solrindex is used in AEM to search by path, property restrictions and primary type restrictions & facted search OOTB ?

1.1) Is AEM 6.x OOTB Solr search results fetch applicable only for full text search (from an OOTB impl) ?

1.2) or Does AEM 6.x OOTB Solr integration supports search results fetch from SOLR  based on property search / faceted search (from an OOTB impl)  ? Any examples for these


2) if not (1.2) supported in AEM 6.1 what is the best approach to fetch the search  (\solr\query API vs SolrJ) results assuming we are on a solr cloud infra?


2.1) What are the pros and cons for \solr\query API vs SolrJ addtional to these that could be a deciding factor to choose  \solr\query vs SolrJ
 \solr\query could enable lighweight javascript / json integration 
 SolrJ is a proxy inside AEM Osgi 

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Sri,

can I ask the reason for your questions? Do you have a specific issue around requirements you are trying to implement or are you just trying to understand the integration?

The reason I ask is that you must be very clear why a customer should use the OOTB Lucene or an external search solution such as SOLR.

There are many search features that are supported(or will be supported, check the oak version in[0] ) such as stemming, synonymns, specllchecking, facets, suggestions, boost.

If you have other search functionality such as federated search, geospatial, natural language search or you wish to use the features that a dedicated search infrastructure provides: Scalable infrastructure, fault tolerant etc. Then in these cases you would use SOLR.

One you have decided to go down this path, you would review the integration and features as defined for AEM6.1(your link is for 6.0)[1] and OAK SOLR[2]. You would then require a POC to see if all your requirements can be met and the performance of the integration.

Your question 1 about property path restrictions are answered in [2]

As described in the documentation when you execute a query the SOLR index will be included in the calculations to determine the cost of each index. The appropriate index will be chosen.

The alternative to using the OAK+SOLR integration is to build your own integration, which is not as scary as it sounds. 

You would either use a web crawler with SOLR to ingest content from your AEM instance or you would push content to SOLR via listeners. You would then use the SOLR web API to run queries and return the content as JSON if you wish. Remember though AEM ACL's are not stored by SOLR. Also, since this is an external search you will incur a latency when running a search against an external provider.

Regards,

Opkar

[0]https://jackrabbit.apache.org/oak/docs/query/lucene.html

[1] https://docs.adobe.com/docs/en/aem/6-1/deploy/platform/queries-and-indexing.html

[2] http://jackrabbit.apache.org/oak/docs/query/solr.html

View solution in original post

4 Replies

Avatar

Level 5

Any Insights on this post will be helpful , Thanks

Avatar

Employee

Have you been through the [0], it provides more details at a lower level about the integration between OAK and SOLR.

Regards,

Opkar

[0]http://jackrabbit.apache.org/oak/docs/query/solr.html

Avatar

Correct answer by
Employee

Hi Sri,

can I ask the reason for your questions? Do you have a specific issue around requirements you are trying to implement or are you just trying to understand the integration?

The reason I ask is that you must be very clear why a customer should use the OOTB Lucene or an external search solution such as SOLR.

There are many search features that are supported(or will be supported, check the oak version in[0] ) such as stemming, synonymns, specllchecking, facets, suggestions, boost.

If you have other search functionality such as federated search, geospatial, natural language search or you wish to use the features that a dedicated search infrastructure provides: Scalable infrastructure, fault tolerant etc. Then in these cases you would use SOLR.

One you have decided to go down this path, you would review the integration and features as defined for AEM6.1(your link is for 6.0)[1] and OAK SOLR[2]. You would then require a POC to see if all your requirements can be met and the performance of the integration.

Your question 1 about property path restrictions are answered in [2]

As described in the documentation when you execute a query the SOLR index will be included in the calculations to determine the cost of each index. The appropriate index will be chosen.

The alternative to using the OAK+SOLR integration is to build your own integration, which is not as scary as it sounds. 

You would either use a web crawler with SOLR to ingest content from your AEM instance or you would push content to SOLR via listeners. You would then use the SOLR web API to run queries and return the content as JSON if you wish. Remember though AEM ACL's are not stored by SOLR. Also, since this is an external search you will incur a latency when running a search against an external provider.

Regards,

Opkar

[0]https://jackrabbit.apache.org/oak/docs/query/lucene.html

[1] https://docs.adobe.com/docs/en/aem/6-1/deploy/platform/queries-and-indexing.html

[2] http://jackrabbit.apache.org/oak/docs/query/solr.html

Avatar

Level 5

Thank Opkar for the reply. Yes  looking to use remote SOLR for property,path,full text ,faceted ,auto type & synonyms etc 

Also I am looking for POC case and in parallel trying to understand the how the OAK JCR query with a property , path constrain fetches the result from an external SOLR integrated with Oak repository with the OOTB repository level integration. Possibly i would like to enable only solrindex under querydefinition and not property and lucene type indexes want to offload the entire search and jcr queries traffic to SOLR

(1) http://jackrabbit.apache.org/oak/docs/query/solr.html - Based on this link as you said jcr property , path query can fetch results OOTB from the solr instance - any idea how this is achived , looks like more of SOLRj is ding the job here 

(2) or  if (1) will be a costly operation should custom solrj retrieval or direct SOLR json api would be better considering still the first hit comes to AEM ( solrj is a proxy there)

(3) Any pointers on solrj vs direct Solr Json queries more from pros and cons perspective

As an example if i have an article content and using OOTB remote solr configuration i can index the required properties & metadata in the remote SOLR cloud by configuring the solrindex and solr schema.xml by which OOTB AEM observation listeners updates the article documents in SOLR . But to fetch the results will my jcr query with property/path constrains get it from SOLR cloud assuming solrindex is used or should I have to create my own fetch results either using solrj or SOLR JSON api? 

Overall trying to understand the best practices in AEM+SOLR setup by which want to offload the entire search and jcr queries traffic to SOLR

Please let me know if any additional point of views