[ 
https://issues.apache.org/jira/browse/LUCENE-7920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16117586#comment-16117586
 ] 

Robert Muir commented on LUCENE-7920:
-------------------------------------

If we decide to do this we should think about the method signature too, because 
{{newPrefixQuery(String,byte[],int)}} is not much different than 
{{newPrefixQuery(String,InetAddress,int)}}, just some overloading with the same 
name. Null is not allowed so its not too bad, but we should still avoid if 
there is an easy way, e.g. different method name or something.

> Make it easier to create ip prefix queries
> ------------------------------------------
>
>                 Key: LUCENE-7920
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7920
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-7920.patch
>
>
> {{InetAddress.getByAddress}} automatically transforms ipv6-mapped ipv4 
> addresses to ipv4 addresses. While this is usually desirable, it can make ip 
> prefix query a bit trappy. For instance the following code:
> {code}
> InetAddressPoint.newPrefixQuery("a", InetAddress.getByName("::ffff:0:0"), 96);
> {code}
> throws an IAE complaining that the prefix length is invalid: {{illegal 
> prefixLength '96'. Must be 0-32 for IPv4 ranges, 0-128 for IPv6 ranges}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to