You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Madhan Neethiraj <ma...@apache.org> on 2020/10/06 20:40:36 UTC

Review Request 72936: updated index-query handling of escape characters, to avoid unnecessary switch to graph query

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

Review request for atlas, Ashutosh Mestry, Jayendra Parab, Nikhil Bonte, Nixon Rodrigues, Pinal Shah, Sarath Subramanian, and Sidharth Mishra.


Repository: atlas


Description
-------

Instead of switching to graph-query when a search attribute value contains a special character, escaping the value with a backslash - per following in Lucene documentation at https://lucene.apache.org/core/6_5_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters:
  Escaping Special Characters
  Lucene supports escaping special characters that are part of the query syntax. The current list special characters are

  + - && || ! ( ) { } [ ] ^ " ~ * ? : \ /

  To escape these character use the \ before the character. For example to search for (1+1):2 use the query:

  (1+1)\:2


Diffs
-----

  intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java e0843cbba 
  intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java 58de4cc47 
  intg/src/main/java/org/apache/atlas/type/AtlasStructType.java b0d88fc47 
  repository/src/main/java/org/apache/atlas/discovery/GraphIndexQueryBuilder.java 35d64b73e 
  repository/src/main/java/org/apache/atlas/discovery/SearchContext.java 2cb287f8a 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java da9dd66bf 


Diff: https://reviews.apache.org/r/72936/diff/1/


Testing
-------

- pre-commit tests run: https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/64/
- verified that basic-search uses index-search for search for attribute values containing special characters, like "-" in guid, and returns correct results


Thanks,

Madhan Neethiraj


Re: Review Request 72936: ATLAS-3983: updated index-query handling of escape characters, to avoid unnecessary switch to graph query

Posted by Sarath Subramanian <sa...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72936/#review222002
-----------------------------------------------------------


Ship it!




Ship It!

- Sarath Subramanian


On Oct. 6, 2020, 1:40 p.m., Madhan Neethiraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72936/
> -----------------------------------------------------------
> 
> (Updated Oct. 6, 2020, 1:40 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Jayendra Parab, Nikhil Bonte, Nixon Rodrigues, Pinal Shah, Sarath Subramanian, and Sidharth Mishra.
> 
> 
> Bugs: ATLAS-3983
>     https://issues.apache.org/jira/browse/ATLAS-3983
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Instead of switching to graph-query when a search attribute value contains a special character, escaping the value with a backslash - per following in Lucene documentation at https://lucene.apache.org/core/6_5_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters:
>   Escaping Special Characters
>   Lucene supports escaping special characters that are part of the query syntax. The current list special characters are
> 
>   + - && || ! ( ) { } [ ] ^ " ~ * ? : \ /
> 
>   To escape these character use the \ before the character. For example to search for (1+1):2 use the query:
> 
>   (1+1)\:2
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java e0843cbba 
>   intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java 58de4cc47 
>   intg/src/main/java/org/apache/atlas/type/AtlasStructType.java b0d88fc47 
>   repository/src/main/java/org/apache/atlas/discovery/GraphIndexQueryBuilder.java 35d64b73e 
>   repository/src/main/java/org/apache/atlas/discovery/SearchContext.java 2cb287f8a 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java da9dd66bf 
> 
> 
> Diff: https://reviews.apache.org/r/72936/diff/1/
> 
> 
> Testing
> -------
> 
> - pre-commit tests run: https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/64/
> - verified that basic-search uses index-search for search for attribute values containing special characters, like "-" in guid, and returns correct results
> 
> 
> Thanks,
> 
> Madhan Neethiraj
> 
>