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-unsubscr...@lucene.apache.org

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


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

Reply via email to