slow-J commented on issue #12243: URL: https://github.com/apache/lucene/issues/12243#issuecomment-1523221285
Thanks for the quick reply @rmuir , I'll try explain the use case better. Calling the existing [`newSetQuery`](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/document/KeywordField.java#L174-L180) takes the array and constructs: [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) TermInSetQueries which both then wrap the array with a list `Arrays.asList(terms)`. So in the case of having a List of BytesRef, we would first call `.toArray`, and then `TermInSetQuery` immediately calls `Arrays.asList`. This seems a bit redundant to me, since there are existing `TermInSetQuery` constructors that take the collection parameters [1](https://github.com/apache/lucene/blob/569533bd76a115e239d8c621d2540462bc12d891/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java#L84), [2](https://github.com/apache/lucene/blob/569533bd76a115e239d8c621d2540462bc12d891/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java#L93). The new `newSetQuery(String field, Collection<BytesRef> values)` method would simply call the `TermInSetQuery` constructors with the collections parameter. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
