Re: Review Request 71738: ATLAS-3517: Enhance suggestions REST API to have optional 'fieldName' parameter to get suggestions from

2019-11-08 Thread Madhan Neethiraj

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71738/#review218581
---


Ship it!




Ship It!

- Madhan Neethiraj


On Nov. 8, 2019, 6:01 p.m., Sarath Subramanian wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71738/
> ---
> 
> (Updated Nov. 8, 2019, 6:01 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Aadarsh Jajodia, Sridhar K, Le Ma, 
> Madhan Neethiraj, Mandar Ambawane, Nikhil Bonte, Nixon Rodrigues, Sameer 
> Shaikh, and Sidharth Mishra.
> 
> 
> Bugs: ATLAS-3517
> https://issues.apache.org/jira/browse/ATLAS-3517
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Suggestions REST API searches against all indexed fields (terms) to retrieve 
> the top frequently used terms.
> 
> we don't have a way to retrieve suggestions only from a specific indexed 
> field.
> 
> This enhancement introduces a new optional parameter in suggestions API - 
> 'fieldName', which when specified will provide suggestions against that 
> indexed field name.
> 
>  
> 
> This will be useful to get suggestions on only a specific field - say labels 
> 
> 
> *Solution:*
> 
> Solr already provides a way to search on etrms against a specific field.
> 
> https://lucene.apache.org/solr/guide/6_6/the-terms-component.html
> 
> "terms.fl=" need to added as part of the request to solr 
> client on terms search
> 
> 
> Diffs
> -
> 
>   
> graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphIndexClient.java
>  09a88d930 
>   
> graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphIndexClient.java
>  278ec5db1 
>   
> intg/src/main/java/org/apache/atlas/model/discovery/AtlasSuggestionsResult.java
>  054ea2e87 
>   
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java
>  3feae27b5 
>   
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
>  23fd7e9c5 
>   
> repository/src/main/java/org/apache/atlas/discovery/SuggestionsProvider.java 
> 4ee1b13a9 
>   
> repository/src/main/java/org/apache/atlas/discovery/SuggestionsProviderImpl.java
>  c00a65066 
>   webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 908ae7033 
> 
> 
> Diff: https://reviews.apache.org/r/71738/diff/2/
> 
> 
> Testing
> ---
> 
> Precommit: 
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/1535/console
> 
> Manually validated that suggestions api filters based on provided field name.
> 
> 
> Thanks,
> 
> Sarath Subramanian
> 
>



Re: Review Request 71738: ATLAS-3517: Enhance suggestions REST API to have optional 'fieldName' parameter to get suggestions from

2019-11-08 Thread Sarath Subramanian

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71738/
---

(Updated Nov. 8, 2019, 10:01 a.m.)


Review request for atlas, Ashutosh Mestry, Aadarsh Jajodia, Sridhar K, Le Ma, 
Madhan Neethiraj, Mandar Ambawane, Nikhil Bonte, Nixon Rodrigues, Sameer 
Shaikh, and Sidharth Mishra.


Changes
---

addresssed review comments.


Bugs: ATLAS-3517
https://issues.apache.org/jira/browse/ATLAS-3517


Repository: atlas


Description
---

Suggestions REST API searches against all indexed fields (terms) to retrieve 
the top frequently used terms.

we don't have a way to retrieve suggestions only from a specific indexed field.

This enhancement introduces a new optional parameter in suggestions API - 
'fieldName', which when specified will provide suggestions against that indexed 
field name.

 

This will be useful to get suggestions on only a specific field - say labels 


*Solution:*

Solr already provides a way to search on etrms against a specific field.

https://lucene.apache.org/solr/guide/6_6/the-terms-component.html

"terms.fl=" need to added as part of the request to solr 
client on terms search


Diffs (updated)
-

  
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphIndexClient.java
 09a88d930 
  
graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphIndexClient.java
 278ec5db1 
  
intg/src/main/java/org/apache/atlas/model/discovery/AtlasSuggestionsResult.java 
054ea2e87 
  
repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java 
3feae27b5 
  
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 
23fd7e9c5 
  repository/src/main/java/org/apache/atlas/discovery/SuggestionsProvider.java 
4ee1b13a9 
  
repository/src/main/java/org/apache/atlas/discovery/SuggestionsProviderImpl.java
 c00a65066 
  webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 908ae7033 


Diff: https://reviews.apache.org/r/71738/diff/2/

Changes: https://reviews.apache.org/r/71738/diff/1-2/


Testing
---

Precommit: 
https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/1535/console

Manually validated that suggestions api filters based on provided field name.


Thanks,

Sarath Subramanian



Re: Review Request 71738: ATLAS-3517: Enhance suggestions REST API to have optional 'fieldName' parameter to get suggestions from

2019-11-07 Thread Madhan Neethiraj

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71738/#review218577
---


Fix it, then Ship it!





repository/src/main/java/org/apache/atlas/discovery/SuggestionsProviderImpl.java
Lines 48 (patched)


Consider handing fieldName==null here, with:
  String indexFieldName = (fieldName == null) ? null : 
typeRegistry.getIndexFieldName(fieldName);


- Madhan Neethiraj


On Nov. 8, 2019, 3:35 a.m., Sarath Subramanian wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71738/
> ---
> 
> (Updated Nov. 8, 2019, 3:35 a.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Aadarsh Jajodia, Sridhar K, Le Ma, 
> Madhan Neethiraj, Mandar Ambawane, Nikhil Bonte, Nixon Rodrigues, Sameer 
> Shaikh, and Sidharth Mishra.
> 
> 
> Bugs: ATLAS-3517
> https://issues.apache.org/jira/browse/ATLAS-3517
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Suggestions REST API searches against all indexed fields (terms) to retrieve 
> the top frequently used terms.
> 
> we don't have a way to retrieve suggestions only from a specific indexed 
> field.
> 
> This enhancement introduces a new optional parameter in suggestions API - 
> 'fieldName', which when specified will provide suggestions against that 
> indexed field name.
> 
>  
> 
> This will be useful to get suggestions on only a specific field - say labels 
> 
> 
> *Solution:*
> 
> Solr already provides a way to search on etrms against a specific field.
> 
> https://lucene.apache.org/solr/guide/6_6/the-terms-component.html
> 
> "terms.fl=" need to added as part of the request to solr 
> client on terms search
> 
> 
> Diffs
> -
> 
>   
> graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphIndexClient.java
>  09a88d930 
>   
> graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphIndexClient.java
>  278ec5db1 
>   
> intg/src/main/java/org/apache/atlas/model/discovery/AtlasSuggestionsResult.java
>  054ea2e87 
>   
> repository/src/main/java/org/apache/atlas/discovery/AtlasDiscoveryService.java
>  3feae27b5 
>   
> repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
>  23fd7e9c5 
>   
> repository/src/main/java/org/apache/atlas/discovery/SuggestionsProvider.java 
> 4ee1b13a9 
>   
> repository/src/main/java/org/apache/atlas/discovery/SuggestionsProviderImpl.java
>  c00a65066 
>   webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 908ae7033 
> 
> 
> Diff: https://reviews.apache.org/r/71738/diff/1/
> 
> 
> Testing
> ---
> 
> Precommit: 
> https://builds.apache.org/view/A/view/Atlas/job/PreCommit-ATLAS-Build-Test/1535/console
> 
> Manually validated that suggestions api filters based on provided field name.
> 
> 
> Thanks,
> 
> Sarath Subramanian
> 
>