You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "slow-J (via GitHub)" <gi...@apache.org> on 2023/11/23 16:13:11 UTC

[PR] Removing TermInSetQuery array ctor [lucene]

slow-J opened a new pull request, #12837:
URL: https://github.com/apache/lucene/pull/12837

   Creating a PR for the items discussed in https://github.com/apache/lucene/issues/12243.
   
   
   
   Currently, calling the [`KeywordField#newSetQuery`](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/document/KeywordField.java#L174-L180) which takes an array and creates:  2 TermInSetQueries (ctors used:[1](https://github.com/apache/lucene/blob/569533bd76a115e239d8c621d2540462bc12d891/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java#L89), [2](https://github.com/apache/lucene/blob/569533bd76a115e239d8c621d2540462bc12d891/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java#L102)) with arrays, the TiSQ then immediately changes the array to a list `Arrays.asList(terms)`.
   
   I initially wanted to add another `KeywordField#newSetQuery` ctor which takes `Collection` as a param to remove the needless calls to change the input to array (currently needed to call KeywordField#newSetQuery), which then gets immediately changed back to collection (when creating TiSQ).
   
   The discussion in the issue, mentioned that since TermInSetQuery has constructors which take both array and collection, we should consolidate them (unless I am misunderstanding).
   
   So in this PR, I am removing the TiSQ array ctor (since order does not matter in this case) and changing the `KeywordField#newSetQuery` param to collection (previously array).
   
   
   
   Closes https://github.com/apache/lucene/issues/12243.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] [10.0] Removing TermInSetQuery varargs ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1841521890

   I think what you said sounds right @slow-J. Having another look at this and the associated bp PR today. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery array ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1832910639

   +1 to this simplification. Let's also get rid of `public TermInSetQuery(RewriteMethod rewriteMethod, String field, BytesRef... terms)`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery array ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1833404097

   > +1 to this simplification. Let's also get rid of `public TermInSetQuery(RewriteMethod rewriteMethod, String field, BytesRef... terms)`?
   
   Thanks Greg, I think I could have been more specific. I did remove this constructor as part of this PR.
   
   I'll change rename references from array -> varargs. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] [10.0] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on code in PR #12837:
URL: https://github.com/apache/lucene/pull/12837#discussion_r1416313463


##########
lucene/CHANGES.txt:
##########
@@ -67,6 +67,8 @@ API Changes
 
 * GITHUB#11023: Adding -level param to CheckIndex, making the old -fast param the default behaviour. (Jakub Slowinski)
 
+* GITHUB#12243: Remove TermInSetQuery ctors taking varargs param. KeywordField#newSetQuery now takes a collection. (Jakub Slowinski)

Review Comment:
   Good point! Can add now while resolving conflicts :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834309861

   @slow-J oh sorry if I missed it. I didn't see it when I looked at the diff, but maybe I was looking at an old commit somehow. Dunno. Either way, it looks good to me! How would you like to handle the back port of this? We'll need to mark the public methods as deprecated on a 9.x release before we remove them on main. Normally, I'd just open a separate PR against 9x that marks deprecation and then remove them on main, but I'm not sure what we should do with some conversation starting about a 10.0 release. If we don't release a 9.10, then I _think_ we'll actually need to mark these public methods as deprecated in the 10.0 release and wait until an 11.0 release to actually remove them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834384051

   > I'd suggest we ask on the dev@ list, but let's see what happens with 9.9 first? If 9.9 RC2 does _not_ go forward, we could try to get the deprecation back port into the 9.9 RC3. Assuming it _does_ go forward, we can ask on the dev list?
   
   Thanks for the suggestion. Sounds good, will do this!
   Let me know if you resolve the problem on your PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] [10.0] Removing TermInSetQuery varargs ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on code in PR #12837:
URL: https://github.com/apache/lucene/pull/12837#discussion_r1416221972


##########
lucene/CHANGES.txt:
##########
@@ -67,6 +67,8 @@ API Changes
 
 * GITHUB#11023: Adding -level param to CheckIndex, making the old -fast param the default behaviour. (Jakub Slowinski)
 
+* GITHUB#12243: Remove TermInSetQuery ctors taking varargs param. KeywordField#newSetQuery now takes a collection. (Jakub Slowinski)

Review Comment:
   I wonder if we should "forward-port" the CHANGES entry from your associated back-port PR as well? Otherwise the CHANGES message under 9.10 noting the deprecation will get lost with 10.0.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834349738

   > @slow-J How would you like to handle the back port of this? We'll need to mark the public methods as deprecated on a 9.x release before we remove them on main. Normally, I'd just open a separate PR against 9x that marks deprecation and then remove them on main, but I'm not sure what we should do with some conversation starting about a 10.0 release. If we don't release a 9.10, then I _think_ we'll actually need to mark these public methods as deprecated in the 10.0 release and wait until an 11.0 release to actually remove them.
   
   Good question @gsmiller 
   
   It looks like it is too late for 9.9.
   Since there is no 10_x branch yet, should I still open a deprecation PR against 9_x and add 9.10 changes to the .txt? I assume that a few other people may be in the same situation so maybe we could hold the discussion around either having a 9.10 version there?
   Otherwise I can repurpose this PR to target 11.0.
   
   
   It’s not a major change but it would be a shame to wait for 11.0 to remove the code. :D
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834496470

   Since the ctors are used internally and I can't just mark them as deprecated with no changes:
   
   My plan for backport is:
   * Keep this PR against main as is.
   * Do another PR against 9_x for Lucene 9.10 with:
     * This entire change, but without removing any public APIs
     * This will also involve in 9_x only: duplicating the SortedSetDocValuesField#newSlowSetQuery SortedDocValuesField#newSlowSetQuery and KeywordField#newSetQuery methods so that the new ones take collections and marking the old ones that take varargs as deprecated.
     * Mark the TermInSetQuery ctors with varargs as deprecated.
   
   How does this sound @gsmiller ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] [10.0] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1841683335

   > Looks good! One minor question about CHANGES. Thanks!
   
   Fixed!
   
   Thanks for the review and for all the help with backporting!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834358456

   I'm not actually sure the best way to handle this. I have another open change right now that would run into this same problem, so I'm interested in the solution too :)
   
   I'd suggest we ask on the dev@ list, but let's see what happens with 9.9 first? If 9.9 RC2 does _not_ go forward, we could try to get the deprecation back port into the 9.9 RC3. Assuming it _does_ go forward, we can ask on the dev list?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Removing TermInSetQuery varargs ctor [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #12837:
URL: https://github.com/apache/lucene/pull/12837#issuecomment-1834391160

   @gsmiller looks like we have a very relevant reply to your previous email!  @jpountz replied:
   “My expectation is that we will do a 9.x minor at about the same time as 10.0 anyway, this is what we have done in the past for new majors. This will give an opportunity to make sure we have deprecation warnings for all breaking changes in 10.0.”


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] [10.0] Removing TermInSetQuery varargs ctor [lucene]

Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller merged PR #12837:
URL: https://github.com/apache/lucene/pull/12837


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org